diff --git a/src/browser-polyfill.js b/src/browser-polyfill.js index 882d9f6b..8e5aef51 100644 --- a/src/browser-polyfill.js +++ b/src/browser-polyfill.js @@ -10,7 +10,7 @@ if (!globalThis.chrome?.runtime?.id) { throw new Error("This script should only be loaded in a browser extension."); } -if (typeof globalThis.browser === "undefined" || Object.getPrototypeOf(globalThis.browser) !== Object.prototype) { +if (typeof globalThis.browser === "undefined" || !(globalThis.browser instanceof Object)) { const CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE = "The message port closed before a response was received."; // Wrapping the bulk of this polyfill in a one-time-use function is a minor