From 9bdba36e592e39f11d7412f1a18bdce9b7f18ede Mon Sep 17 00:00:00 2001 From: Sam Macbeth Date: Mon, 22 May 2023 19:57:12 +0200 Subject: [PATCH] Allow constants.js to be used in non-extension environments (#1998) --- shared/data/constants.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shared/data/constants.js b/shared/data/constants.js index c8f9463047..5ec56e76cc 100644 --- a/shared/data/constants.js +++ b/shared/data/constants.js @@ -4,7 +4,10 @@ const browserInfo = parseUserAgentString() const trackerBlockingEndpointBase = 'https://staticcdn.duckduckgo.com/trackerblocking' function isMV3 () { - return chrome?.runtime.getManifest().manifest_version === 3 + if (typeof chrome !== 'undefined') { + return chrome?.runtime.getManifest().manifest_version === 3 + } + return false } function getConfigFileName () {