mirror of https://github.com/gorhill/uBlock.git
Use more reliable way to check browser environment
This commit is contained in:
parent
cbfd2ad942
commit
b408b9314c
|
@ -34,6 +34,8 @@ import * as ut from './utils.js';
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
const isGecko = browser.runtime.getURL('').startsWith('moz-extension://');
|
||||||
|
|
||||||
const resourceDetailPromises = new Map();
|
const resourceDetailPromises = new Map();
|
||||||
|
|
||||||
function getSpecificDetails() {
|
function getSpecificDetails() {
|
||||||
|
@ -355,7 +357,7 @@ function registerDeclarative(context, declarativeDetails) {
|
||||||
function registerScriptlet(context, scriptletDetails) {
|
function registerScriptlet(context, scriptletDetails) {
|
||||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1736575
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1736575
|
||||||
// `MAIN` world not yet supported in Firefox
|
// `MAIN` world not yet supported in Firefox
|
||||||
if ( navigator && navigator.product === 'Gecko' ) { return; }
|
if ( isGecko ) { return; }
|
||||||
|
|
||||||
const { before, filteringModeDetails, rulesetsDetails } = context;
|
const { before, filteringModeDetails, rulesetsDetails } = context;
|
||||||
|
|
||||||
|
@ -433,7 +435,7 @@ function registerScriptlet(context, scriptletDetails) {
|
||||||
function registerScriptletEntity(context) {
|
function registerScriptletEntity(context) {
|
||||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1736575
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1736575
|
||||||
// `MAIN` world not yet supported in Firefox
|
// `MAIN` world not yet supported in Firefox
|
||||||
if ( navigator && navigator.product === 'Gecko' ) { return; }
|
if ( isGecko ) { return; }
|
||||||
|
|
||||||
const { before, filteringModeDetails, rulesetsDetails } = context;
|
const { before, filteringModeDetails, rulesetsDetails } = context;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue