Explorar o código

fix: JS block not working in background execution (#1134)

Ahmad Kholid %!s(int64=2) %!d(string=hai) anos
pai
achega
405c25f147
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/workflowEngine/blocksHandler/handlerJavascriptCode.js

+ 1 - 1
src/workflowEngine/blocksHandler/handlerJavascriptCode.js

@@ -167,7 +167,7 @@ export async function javascriptCode({ outputs, data, ...block }, { refData }) {
   const inSandbox =
     BROWSER_TYPE !== 'firefox' &&
     data.context === 'background' &&
-    this.engine.isPopup;
+    (this.engine.isMV2 || this.engine.isPopup);
   const result = await (inSandbox
     ? messageSandbox('javascriptBlock', {
         instanceId,