The issue fixed in #153 was introduced again in #582. Now the browser global can be overriden by a DOM element if there is either browser.runtime.id or exports:
|
if (!(globalThis.browser && globalThis.browser.runtime && globalThis.browser.runtime.id)) { |
<form id="browser"></form>
<form id="browser" name="runtime"></form>
|
} else if (typeof exports !== "undefined") { |
This can be fixed by checking that browser.runtime.id and exports are of the correct type, e.g. are not instances of HTMLElement or HTMLCollection.
Credit: discovered by me and skadi.
The issue fixed in #153 was introduced again in #582. Now the
browserglobal can be overriden by a DOM element if there is eitherbrowser.runtime.idorexports:webextension-polyfill/src/browser-polyfill.js
Line 13 in 6a42cbe
webextension-polyfill/scripts/babel-transform-to-umd-module.js
Line 7 in 6a42cbe
This can be fixed by checking that
browser.runtime.idandexportsare of the correct type, e.g. are not instances ofHTMLElementorHTMLCollection.Credit: discovered by me and skadi.