浏览代码

feat: make getActiveTab work with devtools for popup

tophf 5 年之前
父节点
当前提交
c037cd5beb
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/common/index.js

+ 1 - 1
src/common/index.js

@@ -145,7 +145,7 @@ export function decodeFilename(filename) {
 export async function getActiveTab() {
   const [tab] = await browser.tabs.query({
     active: true,
-    lastFocusedWindow: true, // also gets incognito windows
+    windowId: -2, // chrome.windows.WINDOW_ID_CURRENT works when debugging the popup in devtools
   });
   return tab;
 }