Skip to content

Commit

Permalink
Fix no-op check to work with Safari (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
xeenon committed Mar 7, 2024
1 parent 0cf8915 commit 2f1c684
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/browser-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2f1c684

Please sign in to comment.