Pārlūkot izejas kodu

[fix] show popup page

wenliming 2 gadi atpakaļ
vecāks
revīzija
cd9ff3fa83
3 mainītis faili ar 14 papildinājumiem un 8 dzēšanām
  1. 1 5
      src/entry/content.js
  2. 12 1
      src/entry/content_help.js
  3. 1 2
      src/logic/content/twitter.js

+ 1 - 5
src/entry/content.js

@@ -23,8 +23,7 @@ import {
     showNFTSale,
     showNFTSale,
     showBuyNFT,
     showBuyNFT,
     hideBuyNFT,
     hideBuyNFT,
-    showPopupPage,
-    tiggerInjectPopupPage
+    showPopupPage
 } from "@/logic/content/twitter.js";
 } from "@/logic/content/twitter.js";
 
 
 import {
 import {
@@ -112,9 +111,6 @@ chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
         case 'IFRAME_TWITTER_HIDE_BUY_NFT':
         case 'IFRAME_TWITTER_HIDE_BUY_NFT':
             hideBuyNFT()
             hideBuyNFT()
             break
             break
-        case 'BG_INJECT_EXTENSION_POPUP':
-            tiggerInjectPopupPage();
-            break
     }
     }
 })
 })
 
 

+ 12 - 1
src/entry/content_help.js

@@ -1,3 +1,11 @@
+import {
+    appendPopupPage,
+    tiggerInjectPopupPage
+} from "@/logic/content/twitter.js";
+
+window.onload = () => {
+    appendPopupPage();
+};
 
 
 chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
 chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
     sendResponse('')
     sendResponse('')
@@ -6,5 +14,8 @@ chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
             console.log('BACK_PING')
             console.log('BACK_PING')
             chrome.runtime.sendMessage({ actionType: "CONTENT_PONG", data: '1' }, (res) => { console.log(res) })
             chrome.runtime.sendMessage({ actionType: "CONTENT_PONG", data: '1' }, (res) => { console.log(res) })
             break
             break
+        case 'BG_INJECT_EXTENSION_POPUP':
+            tiggerInjectPopupPage();
+            break
     }
     }
-})
+})

+ 1 - 2
src/logic/content/twitter.js

@@ -792,6 +792,7 @@ export function init() {
     console.log('init')
     console.log('init')
 
 
     getDiscordAuthCode();
     getDiscordAuthCode();
+
     let where = window.location.href.indexOf('twitter.com') < 0 && window.location.href.indexOf('facebook.com') < 0;
     let where = window.location.href.indexOf('twitter.com') < 0 && window.location.href.indexOf('facebook.com') < 0;
     if (where) {
     if (where) {
         return
         return
@@ -803,8 +804,6 @@ export function init() {
     renderDom();
     renderDom();
     checkTwitterTaskState();
     checkTwitterTaskState();
 
 
-    appendPopupPage();
-
     onBodyClick();
     onBodyClick();
     initBuyNFT()
     initBuyNFT()