|
@@ -1,6 +1,6 @@
|
|
import { getChromeStorage, setChromeStorage } from '@/uilts/chromeExtension.js'
|
|
import { getChromeStorage, setChromeStorage } from '@/uilts/chromeExtension.js'
|
|
import { throttle, getQueryString, getCookie, nextTick, getQueryStringByUrl } from '@/uilts/help'
|
|
import { throttle, getQueryString, getCookie, nextTick, getQueryStringByUrl } from '@/uilts/help'
|
|
-import { discordAuthRedirectUri } from '@/http/configAPI'
|
|
|
|
|
|
+import { discordAuthRedirectUri, iframeHost } from '@/http/configAPI'
|
|
import { reportSrcPublishEvent } from '@/http/publishApi'
|
|
import { reportSrcPublishEvent } from '@/http/publishApi'
|
|
import Report from "@/log-center/log"
|
|
import Report from "@/log-center/log"
|
|
import { fetchAddFinishEvent } from '@/logic/background/fetch/facebook';
|
|
import { fetchAddFinishEvent } from '@/logic/background/fetch/facebook';
|
|
@@ -9,6 +9,7 @@ import { jumpTwitterDetailByAlert, showEditTweet } from '@/logic/content/help/tw
|
|
import { clearPostContent, setGroupIconStatus } from '@/logic/content/nft.js'
|
|
import { clearPostContent, setGroupIconStatus } from '@/logic/content/nft.js'
|
|
import { toolBox } from '@/logic/content/ToolBox'
|
|
import { toolBox } from '@/logic/content/ToolBox'
|
|
import axios from 'axios';
|
|
import axios from 'axios';
|
|
|
|
+import messageCenter from '@/uilts/messageCenter';
|
|
|
|
|
|
let dom = {};
|
|
let dom = {};
|
|
|
|
|
|
@@ -2060,10 +2061,12 @@ const addPageScrollEvent = () => {
|
|
contentHeight: contentDom.offsetHeight
|
|
contentHeight: contentDom.offsetHeight
|
|
}
|
|
}
|
|
|
|
|
|
- chrome.runtime.sendMessage({
|
|
|
|
- actionType: "CONTENT_GROUP_LIST_SCROLL",
|
|
|
|
- data: data
|
|
|
|
- }, () => { });
|
|
|
|
|
|
+ messageCenter.send('de-tab-group-content', 'CONTENT_GROUP_LIST_SCROLL', data)
|
|
|
|
+
|
|
|
|
+ // chrome.runtime.sendMessage({
|
|
|
|
+ // actionType: "CONTENT_GROUP_LIST_SCROLL",
|
|
|
|
+ // data: data
|
|
|
|
+ // }, () => { });
|
|
};
|
|
};
|
|
|
|
|
|
const removeTweetTabEvent = (params) => {
|
|
const removeTweetTabEvent = (params) => {
|
|
@@ -2144,10 +2147,11 @@ const setGroupTabSelfStyle = (params = {}) => {
|
|
* 切换到 Group tab时 刷新列表
|
|
* 切换到 Group tab时 刷新列表
|
|
*/
|
|
*/
|
|
export const refreshTabGroup = () => {
|
|
export const refreshTabGroup = () => {
|
|
- chrome.runtime.sendMessage({
|
|
|
|
- actionType: "CONTENT_REFRESH_TAB_GROUP_LIST",
|
|
|
|
- data: {}
|
|
|
|
- }, () => { });
|
|
|
|
|
|
+ messageCenter.send('de-tab-group-content', 'CONTENT_REFRESH_TAB_GROUP_LIST', {})
|
|
|
|
+// chrome.runtime.sendMessage({
|
|
|
|
+// actionType: "CONTENT_REFRESH_TAB_GROUP_LIST",
|
|
|
|
+// data: {}
|
|
|
|
+// }, () => { });
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -2224,7 +2228,7 @@ const addTabGroupContent = (cb) => {
|
|
}
|
|
}
|
|
let iframe = document.createElement('iframe');
|
|
let iframe = document.createElement('iframe');
|
|
iframe.id = 'de-tab-group-content';
|
|
iframe.id = 'de-tab-group-content';
|
|
- iframe.src = chrome.runtime.getURL('/iframe/tab-group.html') + `?params=${JSON.stringify(params)}`;
|
|
|
|
|
|
+ iframe.src = `${iframeHost}/tab-group` + `?params=${JSON.stringify(params)}`;
|
|
iframe.style.cssText = `border: medium none; height: 500px;display: none`
|
|
iframe.style.cssText = `border: medium none; height: 500px;display: none`
|
|
|
|
|
|
let iframeContent = getGroupTabContentNode();
|
|
let iframeContent = getGroupTabContentNode();
|
|
@@ -2325,12 +2329,19 @@ export const pageJumpHandler = (params) => {
|
|
export const getTweetProfileNavTop = (params) => {
|
|
export const getTweetProfileNavTop = (params) => {
|
|
let top = document.querySelector('div[role="tablist"]').closest('nav').getBoundingClientRect().top;
|
|
let top = document.querySelector('div[role="tablist"]').closest('nav').getBoundingClientRect().top;
|
|
|
|
|
|
- chrome.runtime.sendMessage({
|
|
|
|
- actionType: "CONTENT_SEND_GROUP_NAV_TOP", data: {
|
|
|
|
|
|
+ messageCenter.send({
|
|
|
|
+ actionType: "CONTENT_SEND_GROUP_NAV_TOP",
|
|
|
|
+ data: {
|
|
top,
|
|
top,
|
|
scrollTop: params.scrollTop
|
|
scrollTop: params.scrollTop
|
|
}
|
|
}
|
|
- }, () => { })
|
|
|
|
|
|
+ })
|
|
|
|
+ // chrome.runtime.sendMessage({
|
|
|
|
+ // actionType: "CONTENT_SEND_GROUP_NAV_TOP", data: {
|
|
|
|
+ // top,
|
|
|
|
+ // scrollTop: params.scrollTop
|
|
|
|
+ // }
|
|
|
|
+ // }, () => { })
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2385,13 +2396,19 @@ const getSysTheme = () => {
|
|
const sysThemeChange = () => {
|
|
const sysThemeChange = () => {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
let bgColor = document.querySelector('body').style.backgroundColor;
|
|
let bgColor = document.querySelector('body').style.backgroundColor;
|
|
-
|
|
|
|
- chrome.runtime.sendMessage({
|
|
|
|
- actionType: "CONTENT_SYS_THEME_CHANGE", data: {
|
|
|
|
|
|
+ messageCenter.send({
|
|
|
|
+ actionType: "CONTENT_SYS_THEME_CHANGE",
|
|
|
|
+ data: {
|
|
theme: systemInfo.theme,
|
|
theme: systemInfo.theme,
|
|
twitterTheme: bgColor == 'rgb(0, 0, 0)' ? 'dark' : 'light'
|
|
twitterTheme: bgColor == 'rgb(0, 0, 0)' ? 'dark' : 'light'
|
|
}
|
|
}
|
|
- }, () => { })
|
|
|
|
|
|
+ })
|
|
|
|
+ // chrome.runtime.sendMessage({
|
|
|
|
+ // actionType: "CONTENT_SYS_THEME_CHANGE", data: {
|
|
|
|
+ // theme: systemInfo.theme,
|
|
|
|
+ // twitterTheme: bgColor == 'rgb(0, 0, 0)' ? 'dark' : 'light'
|
|
|
|
+ // }
|
|
|
|
+ // }, () => { })
|
|
}, 800)
|
|
}, 800)
|
|
}
|
|
}
|
|
|
|
|