diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-09-14 19:57:23 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-09-14 19:57:23 +0200 |
| commit | b0cbc085e1ffee3b5ac14313d646c4638973c8a7 (patch) | |
| tree | c4ecc91921340b684f3802c32a0fd8ed15b6664f /extension | |
| parent | 6717f3d8b71abf255b0e07a5024caa602b5a3d3c (diff) | |
Properly allow multiple
Diffstat (limited to 'extension')
| -rw-r--r-- | extension/junction.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/extension/junction.js b/extension/junction.js index c3cb4e9..1d5f8a5 100644 --- a/extension/junction.js +++ b/extension/junction.js @@ -1,6 +1,6 @@ const internals = { promisesSupported: !!window.browser, - injectedScript: false, + injectedScript: {}, port: null, currentUrl: null, @@ -62,14 +62,15 @@ const internals = { const activeTabs = await internals.getActiveTabs(); internals.currentUrl = activeTabs[0].url; - if (!internals.injectedScript) { + const id = activeTabs[0].id; + if (!internals.injectedScript[id]) { const execution = await internals.getRoot().tabs.executeScript( activeTabs[0].id, { file: "/build/content_script.js", }, () => { - internals.injectedScript = true; + internals.injectedScript[id] = true; }, ); |