瀏覽代碼

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

Ahmad Kholid 2 年之前
父節點
當前提交
405c25f147
共有 1 個文件被更改,包括 1 次插入1 次删除
  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 =
   const inSandbox =
     BROWSER_TYPE !== 'firefox' &&
     BROWSER_TYPE !== 'firefox' &&
     data.context === 'background' &&
     data.context === 'background' &&
-    this.engine.isPopup;
+    (this.engine.isMV2 || this.engine.isPopup);
   const result = await (inSandbox
   const result = await (inSandbox
     ? messageSandbox('javascriptBlock', {
     ? messageSandbox('javascriptBlock', {
         instanceId,
         instanceId,