This PR prevents the issue described in https://github.com/w3c/webextensions/issues/8 from affecting the execution of pageWorld.js. I've never observed the issue happening, though I expect that if it did then it would cause some confusing console errors. I avoid the issue by using the documentIds option to scripting.executeScript() when available (Chrome 106+) and otherwise by checking within the injected script that it's running in the document that requested it.
This PR prevents the issue described in https://github.com/w3c/webextensions/issues/8 from affecting the execution of pageWorld.js. I've never observed the issue happening, though I expect that if it did then it would cause some confusing console errors. I avoid the issue by using the
documentIds
option to scripting.executeScript() when available (Chrome 106+) and otherwise by checking within the injected script that it's running in the document that requested it.