Skip to content

Commit

Permalink
Merge pull request AutomaApp#1156 from AprildreamMI/v2-bg
Browse files Browse the repository at this point in the history
feat: Under v2 background running and creating a separate window should be the same
  • Loading branch information
Kholid060 authored Feb 16, 2023
2 parents c5a6e6e + dabe01b commit 40ccdc3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/background/BackgroundWorkflowUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ class BackgroundWorkflowUtils {
static async executeWorkflow(workflowData, options) {
if (workflowData.isDisabled) return;

startWorkflowExec(workflowData, options, false);
/**
* Under v2, the background runtime environment is a real browser window. It has DOM, URL...
But these don't exist under v3. v3 uses service_worker (https://developer.mozilla.org/zh-CN/docs/Web/API/Service_Worker_API), so a dashboard page is created to run the workflow
So v2 and isPopup are actually the same
*/
const isMV2 = browser.runtime.getManifest().manifest_version === 2;
startWorkflowExec(workflowData, options, isMV2);
}
}

Expand Down

0 comments on commit 40ccdc3

Please sign in to comment.