소스 검색

fix: default window size

siykt 1 년 전
부모
커밋
ded4bec58e
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      src/background/BackgroundUtils.js

+ 3 - 2
src/background/BackgroundUtils.js

@@ -25,11 +25,12 @@ class BackgroundUtils {
           });
         }
       } else {
+        const curWin = await browser.windows.getCurrent();
         const windowOptions = {
           top: 0,
           left: 0,
-          width: 715,
-          height: 715,
+          width: Math.min(curWin.width, 715),
+          height: Math.min(curWin.height, 715),
           url: tabUrl,
           type: 'popup',
         };