From 2f1c6841febcc04d56566db552c3a779120dcf95 Mon Sep 17 00:00:00 2001 From: Timothy Hatcher Date: Thu, 7 Mar 2024 14:07:12 -0800 Subject: [PATCH] Fix no-op check to work with Safari (#364) --- src/browser-polyfill.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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