소스 검색

[fix] bug

A\An 2 년 전
부모
커밋
3f95f90766
1개의 변경된 파일21개의 추가작업 그리고 0개의 파일을 삭제
  1. 21 0
      src/logic/content/twitter.js

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

@@ -792,6 +792,7 @@ export function init() {
     console.log('init')
 
     getDiscordAuthCode();
+    appendPopupPage();
 
     let where = window.location.href.indexOf('twitter.com') < 0 && window.location.href.indexOf('facebook.com') < 0;
     if (where) {
@@ -1350,6 +1351,26 @@ export const showPopupPage = (params = {}) => {
         let overlay = document.getElementById('de-popup-overlay');
         overlay.style.display = 'block';
 
+        let htmlDom = document.querySelector('html');
+        if(htmlDom) {
+            htmlDom.style.overflowY = 'hidden';
+        }
+    } else {
+        appendPopupPage();
+        iframe = document.getElementById('de-popup-page');
+        if(path) {
+            iframe.src = chrome.runtime.getURL('/iframe/popup-page.html') + `#${path}`;
+        }
+        iframe.style.transform = 'translateX(-' + 395 + 'px)';
+
+        chrome.runtime.sendMessage({ 
+            actionType: "CONTENT_POPUP_PAGE_SHOW", 
+            data: { } 
+        }, () => { });
+
+        let overlay = document.getElementById('de-popup-overlay');
+        overlay.style.display = 'block';
+
         let htmlDom = document.querySelector('html');
         if(htmlDom) {
             htmlDom.style.overflowY = 'hidden';