diff --git a/platform/mv3/extension/js/scripting-manager.js b/platform/mv3/extension/js/scripting-manager.js index c90b942a4..65ea39974 100644 --- a/platform/mv3/extension/js/scripting-manager.js +++ b/platform/mv3/extension/js/scripting-manager.js @@ -34,6 +34,8 @@ import * as ut from './utils.js'; /******************************************************************************/ +const isGecko = browser.runtime.getURL('').startsWith('moz-extension://'); + const resourceDetailPromises = new Map(); function getSpecificDetails() { @@ -355,7 +357,7 @@ function registerDeclarative(context, declarativeDetails) { function registerScriptlet(context, scriptletDetails) { // https://bugzilla.mozilla.org/show_bug.cgi?id=1736575 // `MAIN` world not yet supported in Firefox - if ( navigator && navigator.product === 'Gecko' ) { return; } + if ( isGecko ) { return; } const { before, filteringModeDetails, rulesetsDetails } = context; @@ -433,7 +435,7 @@ function registerScriptlet(context, scriptletDetails) { function registerScriptletEntity(context) { // https://bugzilla.mozilla.org/show_bug.cgi?id=1736575 // `MAIN` world not yet supported in Firefox - if ( navigator && navigator.product === 'Gecko' ) { return; } + if ( isGecko ) { return; } const { before, filteringModeDetails, rulesetsDetails } = context;