|
@@ -586,9 +586,9 @@ async function parseDOMRedPacketByShortUrl(port) {
|
|
|
if (parse_dom.postId && parse_dom.tweetId) {
|
|
|
console.log('bindTwitterArt.postId', bindTwitterArt.postId)
|
|
|
console.log('parse_dom.postId', parse_dom.postId)
|
|
|
- if (bindTwitterArt.needBind) {
|
|
|
- bindTwitterArtMethod({ postId: parse_dom.postId, twitterId: parse_dom.tweetId });
|
|
|
- }
|
|
|
+ // if (bindTwitterArt.needBind) {
|
|
|
+ // bindTwitterArtMethod({ postId: parse_dom.postId, twitterId: parse_dom.tweetId });
|
|
|
+ // }
|
|
|
if (parse_dom.dom) {
|
|
|
parse_dom.type = 'card'
|
|
|
} else {
|
|
@@ -636,10 +636,11 @@ async function handleShortUrl(port, url) {
|
|
|
} else {
|
|
|
// 防止多次请求,校验timeout时间
|
|
|
let _new_time = new Date().getTime()
|
|
|
- if (_new_time - _item[0].time > 5000) {
|
|
|
+ if (_new_time - _item[0].time > 1000) {
|
|
|
for (let i in sort_link_data) {
|
|
|
if (sort_link_data[i].url == url) {
|
|
|
sort_link_data[i].time = _new_time
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
setChromeStorage({ sortLink: JSON.stringify(sort_link_data) })
|
|
@@ -695,11 +696,12 @@ function replaceDOMRedPacket(_type, _dom, postId, tweetId) {
|
|
|
|
|
|
let change_time = new Date().getTime()
|
|
|
function onChangePageMain(port, targetNode) {
|
|
|
- const config = { attributes: true, childList: true, subtree: true };
|
|
|
+ const config = { attributes: false, childList: true, subtree: true };
|
|
|
const callback = (mutationsList, observer) => {
|
|
|
+ parseDOMRedPacketByShortUrl(port)
|
|
|
setTimeout(() => {
|
|
|
parseDOMRedPacketByShortUrl(port)
|
|
|
- }, 1500)
|
|
|
+ }, 1100)
|
|
|
}
|
|
|
const observer = new MutationObserver(callback);
|
|
|
observer.observe(targetNode, config);
|
|
@@ -726,11 +728,11 @@ function setIframeRedPacket(port) {
|
|
|
}, 1000);
|
|
|
}
|
|
|
|
|
|
-export function initExecuteScript(changes) {
|
|
|
+export function initExecuteScript(port,changes) {
|
|
|
if (changes.executeScript) {
|
|
|
let item = JSON.parse(changes.executeScript.newValue)
|
|
|
if (item.executeScript) {
|
|
|
- init()
|
|
|
+ init(port)
|
|
|
}
|
|
|
}
|
|
|
}
|