|
@@ -1104,7 +1104,7 @@ export const getTweetUserFollowStatus = (params) => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- messageCenter.send({
|
|
|
+ contentMessageCenter.send({
|
|
|
info: {
|
|
|
iframeId: params.iframeId,
|
|
|
actionType: 'CONTENT_GET_TWEET_USER_FOLLOW_STATUS_RES'
|
|
@@ -1116,7 +1116,7 @@ export const getTweetUserFollowStatus = (params) => {
|
|
|
|
|
|
// chrome.runtime.sendMessage({ actionType: 'CONTENT_GET_TWEET_USER_FOLLOW_STATUS_RES', data: list, tweetId, type: params.type, iframeId: params.iframeId }, () => { })
|
|
|
}).catch(err => {
|
|
|
- messageCenter.send({
|
|
|
+ contentMessageCenter.send({
|
|
|
info: {
|
|
|
iframeId: params.iframeId,
|
|
|
actionType: 'CONTENT_GET_TWEET_USER_FOLLOW_STATUS_RES'
|
|
@@ -1174,8 +1174,8 @@ export function facebookReplyTweet({ info, data }) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-export function replyHandle(params) {
|
|
|
- let iframe = window.parent.document.getElementById(params.iframeId);
|
|
|
+export function replyHandle({ info, data}) {
|
|
|
+ let iframe = window.parent.document.getElementById(data.iframeId);
|
|
|
let replyBtn = iframe.parentNode.parentNode.querySelector('div[data-testid="reply"]') ||
|
|
|
iframe.parentNode.parentNode.parentNode.querySelector('div[data-testid="reply"]');
|
|
|
if (replyBtn) {
|
|
@@ -1197,8 +1197,16 @@ 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 } }, '*');
|
|
|
+ reportReplyResult(eleList, data, () => {
|
|
|
+ contentMessageCenter.send({
|
|
|
+ info: {
|
|
|
+ actionType: 'CONTENT_RED_PACKET_REPLY_RASK_FINSH',
|
|
|
+ iframeId: info.iframeId
|
|
|
+ },
|
|
|
+ data: { postId: data.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 } }, () => { })
|
|
|
});
|
|
|
})
|
|
@@ -1255,7 +1263,15 @@ 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 } }, '*');
|
|
|
+ contentMessageCenter.send({
|
|
|
+ info: {
|
|
|
+ actionType: 'CONTENT_RED_PACKET_REPLY_RASK_FINSH',
|
|
|
+ iframeId: params.iframeId
|
|
|
+ },
|
|
|
+ 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 } }, () => { })
|
|
|
})
|
|
|
});
|
|
@@ -1766,7 +1782,7 @@ const TwitterApiCreateTweet = ({ text, tweet_Id, iframeId,
|
|
|
console.log(response)
|
|
|
let data = response.data;
|
|
|
if (iframeMsg) {
|
|
|
- messageCenter.send({
|
|
|
+ contentMessageCenter.send({
|
|
|
info: {
|
|
|
iframeId,
|
|
|
actionType: 'CONTENT_CREATE_TWEET_FINISH'
|
|
@@ -1781,7 +1797,7 @@ const TwitterApiCreateTweet = ({ text, tweet_Id, iframeId,
|
|
|
}).catch(function (err) {
|
|
|
console.log('err --1', err)
|
|
|
if (iframeMsg) {
|
|
|
- messageCenter.send({
|
|
|
+ contentMessageCenter.send({
|
|
|
info: {
|
|
|
iframeId,
|
|
|
actionType: 'CONTENT_CREATE_TWEET_FINISH'
|
|
@@ -1825,7 +1841,7 @@ export const TwitterApiUserByScreenName = (params, cb) => {
|
|
|
|
|
|
TwitterApiUserByScreenNameReq({ screen_name }).then(function (response) {
|
|
|
if (iframeMsg) {
|
|
|
- messageCenter.send({
|
|
|
+ contentMessageCenter.send({
|
|
|
info: {
|
|
|
iframeId,
|
|
|
actionType: 'CONTENT_API_GET_TWEET_USER_INFO_END'
|
|
@@ -1840,7 +1856,7 @@ export const TwitterApiUserByScreenName = (params, cb) => {
|
|
|
|
|
|
}).catch(function (err) {
|
|
|
if (iframeMsg) {
|
|
|
- messageCenter.send({
|
|
|
+ contentMessageCenter.send({
|
|
|
info: {
|
|
|
iframeId,
|
|
|
actionType: 'CONTENT_API_GET_TWEET_USER_INFO_END'
|
|
@@ -2843,7 +2859,7 @@ export const getExtensionStorgeDataForIframe = (req) => {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-export const setExtensionStorgeDataForIframe = ({ info, data}) => {
|
|
|
+export const setExtensionStorgeDataForIframe = ({ info, data}) => {
|
|
|
setChromeStorage(data)
|
|
|
}
|
|
|
|
|
@@ -2915,7 +2931,7 @@ export const sendContentByTwitterID = (params) => {
|
|
|
let { tweet_Id, iframeGUId } = JSON.parse(params.data);
|
|
|
// 获取内容
|
|
|
let txt = parseCard.getContentByTwitterId(tweet_Id);
|
|
|
- messageCenter.send({
|
|
|
+ contentMessageCenter.send({
|
|
|
info: {
|
|
|
iframeId: params.iframeId,
|
|
|
actionType: 'CONTENT_GET_TWEET_TXT'
|
|
@@ -2933,7 +2949,7 @@ export const sendContentByTwitterID = (params) => {
|
|
|
// })
|
|
|
}
|
|
|
|
|
|
-export const sendLoginSuccessToAllIframe = () => {
|
|
|
+export const sendLoginSuccessToAllIframe = () => {
|
|
|
contentMessageCenter.sendAll({
|
|
|
info: {
|
|
|
actionType: "BACK_DISCORD_LOGIN_SUCCESS"
|
|
@@ -2941,7 +2957,7 @@ export const sendLoginSuccessToAllIframe = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-export const sendIframeLoginToBackground = () => {
|
|
|
+export const sendIframeLoginToBackground = () => {
|
|
|
chromeMessageCenter.sendToSW({
|
|
|
info: {
|
|
|
actionType: "POPUP_LOGIN"
|
|
@@ -2949,7 +2965,7 @@ export const sendIframeLoginToBackground = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-export const openUrlInNewWindow = ({ info, data }) => {
|
|
|
+export const openUrlInNewWindow = ({ info, data }) => {
|
|
|
chromeMessageCenter.sendToSW({
|
|
|
info: {
|
|
|
actionType: "OPEN_URL_IN_NEW_WINDOW_BG"
|
|
@@ -2958,7 +2974,7 @@ export const openUrlInNewWindow = ({ info, data }) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-export const sendAllFacebookShareSuccess = (data) => {
|
|
|
+export const sendAllFacebookShareSuccess = (data) => {
|
|
|
contentMessageCenter.sendAll({
|
|
|
info: {
|
|
|
actionType: "BG_FACEBOOK_SHARE_SUCCESS"
|
|
@@ -2967,7 +2983,7 @@ export const sendAllFacebookShareSuccess = (data) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-export const sendUserSettingMessageToAllIframe = (data) => {
|
|
|
+export const sendUserSettingMessageToAllIframe = (data) => {
|
|
|
contentMessageCenter.sendAll({
|
|
|
info: {
|
|
|
actionType: "USER_SETTING"
|