mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 01:02:08 +01:00
Use more reliable way to check browser environment
This commit is contained in:
parent
cbfd2ad942
commit
b408b9314c
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue