|
@@ -683,13 +683,13 @@ function addSliderNavDeBtn() {
|
|
|
let floatingTweetBtn;
|
|
|
let tweetBtn = document.querySelector('a[data-testid="SideNav_NewTweet_Button"]');
|
|
|
if (tweetBtn) {
|
|
|
- if(tweetBtn.querySelector('svg')) {
|
|
|
+ if (tweetBtn.querySelector('svg')) {
|
|
|
isSmall = true;
|
|
|
}
|
|
|
} else {
|
|
|
// 手机打开twitter 发推按钮
|
|
|
floatingTweetBtn = document.querySelector('div[data-testid="FloatingActionButtonBase"]');
|
|
|
- if(floatingTweetBtn) {
|
|
|
+ if (floatingTweetBtn) {
|
|
|
isFloating = true;
|
|
|
}
|
|
|
}
|
|
@@ -707,7 +707,7 @@ function addSliderNavDeBtn() {
|
|
|
}
|
|
|
} else {
|
|
|
let deBtn3 = document.getElementById('de-btn3');
|
|
|
- if(isFloating && !deBtn3) {
|
|
|
+ if (isFloating && !deBtn3) {
|
|
|
floatingTweetBtn.appendChild(dom.deBtn3);
|
|
|
} else {
|
|
|
let smallDom = document.querySelector('a[href="/compose/tweet"]').parentNode.parentNode;
|
|
@@ -1192,7 +1192,7 @@ export function replyHandle(params) {
|
|
|
|
|
|
let eleList = tweetReply.parentNode.parentNode.parentNode.parentNode.parentNode.querySelectorAll('span[data-text="true"]');
|
|
|
reportReplyResult(eleList, params, () => {
|
|
|
- iframe.contentWindow.postMessage({ actionType: 'CONTENT_RED_PACKET_REPLY_RASK_FINSH', data: {postId: params.postId } }, '*');
|
|
|
+ iframe.contentWindow.postMessage({ actionType: 'CONTENT_RED_PACKET_REPLY_RASK_FINSH', data: { postId: params.postId } }, '*');
|
|
|
// chrome.runtime.sendMessage({ actionType: "CONTENT_RED_PACKET_REPLY_RASK_FINSH", data: { postId: params.postId } }, () => { })
|
|
|
});
|
|
|
})
|
|
@@ -1249,7 +1249,7 @@ function onReplyDialogOpen(params, iframe) {
|
|
|
let eleList = dialog.querySelector('div[contenteditable="true"]').querySelectorAll('span[data-text="true"]');
|
|
|
reportReplyResult(eleList, params, () => {
|
|
|
// 上報完成
|
|
|
- iframe.contentWindow.postMessage({ actionType: 'CONTENT_RED_PACKET_REPLY_RASK_FINSH', data: {postId: params.postId} }, '*');
|
|
|
+ iframe.contentWindow.postMessage({ actionType: 'CONTENT_RED_PACKET_REPLY_RASK_FINSH', data: { postId: params.postId } }, '*');
|
|
|
// chrome.runtime.sendMessage({ actionType: "CONTENT_RED_PACKET_REPLY_RASK_FINSH", data: { postId: params.postId } }, () => { })
|
|
|
})
|
|
|
});
|
|
@@ -1525,46 +1525,46 @@ export function showJoinDialog(data) {
|
|
|
}
|
|
|
|
|
|
const TwitterFriendshipsUpdate = (params) => {
|
|
|
- let {id = '', device = true, name} = params || {};
|
|
|
- let data = {
|
|
|
- include_profile_interstitial_type: 1,
|
|
|
- include_blocking: 1,
|
|
|
- include_blocked_by: 1,
|
|
|
- include_followed_by: 1,
|
|
|
- include_want_retweets: 1,
|
|
|
- include_mute_edge: 1,
|
|
|
- include_can_dm: 1,
|
|
|
- include_can_media_tag: 1,
|
|
|
- include_ext_has_nft_avatar: 1,
|
|
|
- skip_status: 1,
|
|
|
- cursor: -1,
|
|
|
- id,
|
|
|
- device
|
|
|
- }
|
|
|
- if(!id) {
|
|
|
- return;
|
|
|
- }
|
|
|
- let url = isMobileTwitter() ? 'https://mobile.twitter.com/i/api/1.1/friendships/update.json' : "https://twitter.com/i/api/1.1/friendships/update.json";
|
|
|
- return fetch(url, {
|
|
|
- "headers": {
|
|
|
- "authorization": "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA",
|
|
|
- "content-type": "application/x-www-form-urlencoded",
|
|
|
- "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"102\", \"Google Chrome\";v=\"102\"",
|
|
|
- "sec-ch-ua-mobile": "?0",
|
|
|
- "sec-ch-ua-platform": "\"macOS\"",
|
|
|
- "x-csrf-token": getCookie('ct0'),
|
|
|
- "x-twitter-active-user": "yes",
|
|
|
- "x-twitter-auth-type": "OAuth2Session",
|
|
|
- "x-twitter-client-language": "en",
|
|
|
- "referer": `https://twitter.com/${name}`
|
|
|
- },
|
|
|
- "referrer": `https://twitter.com/${name}`,
|
|
|
- "referrerPolicy": "strict-origin-when-cross-origin",
|
|
|
- "body": `include_profile_interstitial_type=1&include_blocking=1&include_blocked_by=1&include_followed_by=1&include_want_retweets=1&include_mute_edge=1&include_can_dm=1&include_can_media_tag=1&include_ext_has_nft_avatar=1&skip_status=1&cursor=-1&id=${id}&device=true`,
|
|
|
- "method": "POST",
|
|
|
- "mode": "cors",
|
|
|
- "credentials": "include"
|
|
|
- })
|
|
|
+ let { id = '', device = true, name } = params || {};
|
|
|
+ let data = {
|
|
|
+ include_profile_interstitial_type: 1,
|
|
|
+ include_blocking: 1,
|
|
|
+ include_blocked_by: 1,
|
|
|
+ include_followed_by: 1,
|
|
|
+ include_want_retweets: 1,
|
|
|
+ include_mute_edge: 1,
|
|
|
+ include_can_dm: 1,
|
|
|
+ include_can_media_tag: 1,
|
|
|
+ include_ext_has_nft_avatar: 1,
|
|
|
+ skip_status: 1,
|
|
|
+ cursor: -1,
|
|
|
+ id,
|
|
|
+ device
|
|
|
+ }
|
|
|
+ if (!id) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let url = isMobileTwitter() ? 'https://mobile.twitter.com/i/api/1.1/friendships/update.json' : "https://twitter.com/i/api/1.1/friendships/update.json";
|
|
|
+ return fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "authorization": "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA",
|
|
|
+ "content-type": "application/x-www-form-urlencoded",
|
|
|
+ "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"102\", \"Google Chrome\";v=\"102\"",
|
|
|
+ "sec-ch-ua-mobile": "?0",
|
|
|
+ "sec-ch-ua-platform": "\"macOS\"",
|
|
|
+ "x-csrf-token": getCookie('ct0'),
|
|
|
+ "x-twitter-active-user": "yes",
|
|
|
+ "x-twitter-auth-type": "OAuth2Session",
|
|
|
+ "x-twitter-client-language": "en",
|
|
|
+ "referer": `https://twitter.com/${name}`
|
|
|
+ },
|
|
|
+ "referrer": `https://twitter.com/${name}`,
|
|
|
+ "referrerPolicy": "strict-origin-when-cross-origin",
|
|
|
+ "body": `include_profile_interstitial_type=1&include_blocking=1&include_blocked_by=1&include_followed_by=1&include_want_retweets=1&include_mute_edge=1&include_can_dm=1&include_can_media_tag=1&include_ext_has_nft_avatar=1&skip_status=1&cursor=-1&id=${id}&device=true`,
|
|
|
+ "method": "POST",
|
|
|
+ "mode": "cors",
|
|
|
+ "credentials": "include"
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
const TwitterFollowAPI = (item, tweet_Id) => {
|