From 12bdd01595c2e7ac04404f38da0e1f1ef9a6ec27 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 11 May 2019 09:04:13 -0400 Subject: [PATCH] Ensure "Ignore generic cosmetic filters" sticks on Fennec Related issue: - https://www.reddit.com/r/uBlockOrigin/comments/blkudl/ The setting was not sticking at first-install time. --- src/js/background.js | 2 +- src/js/start.js | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/js/background.js b/src/js/background.js index 82a2c8fed..334f27bb9 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -82,7 +82,7 @@ const µBlock = (function() { // jshint ignore:line externalLists: [], firewallPaneMinimized: true, hyperlinkAuditingDisabled: true, - ignoreGenericCosmeticFilters: false, + ignoreGenericCosmeticFilters: vAPI.webextFlavor.soup.has('mobile'), largeMediaSize: 50, parseAllABPHideFilters: true, prefetchingDisabled: true, diff --git a/src/js/start.js b/src/js/start.js index 592686d0e..37adb7af2 100644 --- a/src/js/start.js +++ b/src/js/start.js @@ -186,11 +186,11 @@ const onVersionReady = function(lastVersion) { // If unused, just comment out for when we need to compare versions in the // future. const intFromVersion = function(s) { - let parts = s.match(/(?:^|\.|b|rc)\d+/g); + const parts = s.match(/(?:^|\.|b|rc)\d+/g); if ( parts === null ) { return 0; } let vint = 0; for ( let i = 0; i < 4; i++ ) { - let pstr = parts[i] || ''; + const pstr = parts[i] || ''; let pint; if ( pstr === '' ) { pint = 0; @@ -206,7 +206,7 @@ const onVersionReady = function(lastVersion) { return vint; }; - let lastVersionInt = intFromVersion(lastVersion); + const lastVersionInt = intFromVersion(lastVersion); if ( lastVersionInt <= 1016021007 ) { µb.sessionSwitches.toggle('no-scripting', 'behind-the-scene', 2); @@ -262,13 +262,6 @@ const onUserSettingsReady = function(fetched) { µb.sessionURLFiltering.assign(µb.permanentURLFiltering); µb.permanentSwitches.fromString(fetched.hostnameSwitchesString); µb.sessionSwitches.assign(µb.permanentSwitches); - - // https://github.com/gorhill/uBlock/issues/1892 - // For first installation on a battery-powered device, disable generic - // cosmetic filtering. - if ( µb.firstInstall && vAPI.webextFlavor.soup.has('mobile') ) { - userSettings.ignoreGenericCosmeticFilters = true; - } }; /******************************************************************************/