Browse Source

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

Ahmad Kholid 2 năm trước cách đây
mục cha
commit
405c25f147
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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,