瀏覽代碼

Merge pull request #1365 from Siykt/fix/dashboard-dont-open

Fix: set default window size
Ahmad Kholid 1 年之前
父節點
當前提交
757677e874
共有 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',
         };