Browse Source

[fix] bug

wenliming 2 years ago
parent
commit
bfb3503647

+ 6 - 1
src/entry/background.js

@@ -15,7 +15,8 @@ import {
     saveDiscordAuthWindowId,
     onDisconnectHandler,
     getMessageInfo,
-    injectExtensionPopup
+    injectExtensionPopup,
+    setPopupConfig
 } from "@/logic/background/twitter";
 
 import { PingPong } from "@/logic/background/help";
@@ -60,6 +61,10 @@ chrome.action.onClicked.addListener(function(tab) {
     injectExtensionPopup(tab);
 });
 
+chrome.tabs.onActivated.addListener(function(activeInfo) {
+    setPopupConfig(activeInfo);
+})
+
 function onInstalledMethod() {
     onInstalledCreateTab()
     onInstalledMid()

+ 22 - 0
src/logic/background/twitter.js

@@ -371,4 +371,26 @@ export const injectExtensionPopup = (tab) => {
     sendActivetabMessage({
         actionType: 'BG_INJECT_EXTENSION_POPUP'
     });
+}
+
+export const setPopupConfig = (activeInfo) => {
+    chrome.tabs.query({
+        active: true,
+        currentWindow: true
+    }, (tabs) => {
+        if(tabs.length) {
+            let {pendingUrl = '', url = ''} = tabs[0];
+            if(pendingUrl.startsWith('chrome://') || url.startsWith('chrome://')) {
+                chrome.action.setPopup({
+                    popup: 'popup.html',
+                },function() {
+                });
+            } else {
+                chrome.action.setPopup({
+                    popup: '',
+                },function() {
+                });
+            }
+        }
+    })
 }

+ 10 - 0
src/logic/content/twitter.js

@@ -1349,6 +1349,11 @@ export const showPopupPage = (params = {}) => {
 
         let overlay = document.getElementById('de-popup-overlay');
         overlay.style.display = 'block';
+
+        let body = document.querySelector('body');
+        if(body) {
+            body.style.overflowY = 'hidden';
+        }
     }
 }
 
@@ -1359,6 +1364,11 @@ export const hidePopupPage = () => {
 
         let overlay = document.getElementById('de-popup-overlay');
         overlay.style.display = 'none';
+
+        let body = document.querySelector('body');
+        if(body) {
+            body.style.overflowY = 'auto';
+        }
     }
 }
 

+ 2 - 2
src/view/components/popup-transactions.vue

@@ -22,7 +22,7 @@
                         <template v-if="item.bizType == 1">
                             <img class="icon-avatar" :src="item.bizData.avatarUrl" />
                             <img class="icon-give" :src="
-                                require('@/assets/svg/icon-giveaways.svg')
+                                require('@/assets/svg/icon-get-giveaways-s.svg')
                             " />
                         </template>
                         <!-- 收入- 任务红包结余退款, -->
@@ -360,7 +360,7 @@ const listScroll = (e) => {
                 .icon-give {
                     position: absolute;
                     right: -4px;
-                    bottom: 2px;
+                    top: 19px;
                 }
             }
 

+ 6 - 4
src/view/popup/tabbar-page/message/index.vue

@@ -501,22 +501,22 @@ onBeforeUnmount(() => {
             box-sizing: border-box;
 
             .icon-avatar {
-              width: 34px;
-              height: 34px;
+              width: 36px;
+              height: 36px;
               border-radius: 50%;
               margin-right: 8px;
             }
 
             .icon-give {
               position: absolute;
-              right: 3px;
+              right: 1px;
               bottom: -1px;
               width: 18px;
               height: 18px;
             }
 
             .icon-big-give {
-              margin-top: 14px;
+              margin-top: 12px;
             }
           }
 
@@ -556,6 +556,7 @@ onBeforeUnmount(() => {
                   display: flex;
                   justify-content: flex-end;
                   align-items: center;
+                  max-width: 140px;
 
                   .blance {
                     margin-left: 3px;
@@ -573,6 +574,7 @@ onBeforeUnmount(() => {
 
                   .coin-type {
                     margin-left: 3px;
+                    word-break: break-all;
                   }
 
                   img {