X-Git-Url: https://git.r.bdr.sh/rbdr/junction/blobdiff_plain/bab26a4da2a2a0fdc88ec3af56909b12d822113a..650c5f155e98dc8428ab617a535541736c9dd08f:/extension/junction.js 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; }, );