Browse Source

fix: active tab block

Ahmad Kholid 2 years ago
parent
commit
9d78bfa200
1 changed files with 12 additions and 0 deletions
  1. 12 0
      src/workflowEngine/blocksHandler/handlerActiveTab.js

+ 12 - 0
src/workflowEngine/blocksHandler/handlerActiveTab.js

@@ -44,6 +44,18 @@ async function activeTab(block) {
       if (windowId) tabsQuery.windowId = windowId;
       else if (windows.length > 2) tabsQuery.lastFocusedWindow = true;
     } else {
+      const dashboardTabs = await browser.tabs.query({
+        url: browser.runtime.getURL('/newtab.html'),
+      });
+      await Promise.all(
+        dashboardTabs.map((item) =>
+          browser.windows.update(item.windowId, {
+            state: 'minimized',
+            focused: false,
+          })
+        )
+      );
+
       tabsQuery.currentWindow = true;
     }