Browse Source

fix: debugger not working when using active tab block

Ahmad Kholid 3 years ago
parent
commit
aa3eeb00b8
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/background/workflowEngine/blocksHandler/handlerActiveTab.js

+ 6 - 1
src/background/workflowEngine/blocksHandler/handlerActiveTab.js

@@ -1,5 +1,5 @@
 import browser from 'webextension-polyfill';
 import browser from 'webextension-polyfill';
-import { getBlockConnection } from '../helper';
+import { getBlockConnection, attachDebugger } from '../helper';
 
 
 async function activeTab(block) {
 async function activeTab(block) {
   const nextBlockId = getBlockConnection(block);
   const nextBlockId = getBlockConnection(block);
@@ -36,6 +36,11 @@ async function activeTab(block) {
     };
     };
     this.windowId = tab.windowId;
     this.windowId = tab.windowId;
 
 
+    if (this.settings.debugMode) {
+      await attachDebugger(tab.id, this.activeTab.id);
+      this.debugAttached = true;
+    }
+
     if (this.preloadScripts.length > 0) {
     if (this.preloadScripts.length > 0) {
       const preloadScripts = this.preloadScripts.map((script) =>
       const preloadScripts = this.preloadScripts.map((script) =>
         this._sendMessageToTab(script)
         this._sendMessageToTab(script)