diff --git a/src/js/background.js b/src/js/background.js index 0e8e5e8075748..abf774532975a 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -53,7 +53,7 @@ const µBlock = (function() { // jshint ignore:line requestJournalProcessPeriod: 1000, selfieAfter: 11, strictBlockingBypassDuration: 120, - suspendTabsUntilReady: false, + suspendTabsUntilReady: 'unset', userResourcesLocation: 'unset' }; @@ -104,6 +104,11 @@ const µBlock = (function() { // jshint ignore:line if ( out.hasOwnProperty(k) ) { out[k] = o[k]; } } self.log.verbosity = out.consoleLogLevel; + if ( typeof out.suspendTabsUntilReady === 'boolean' ) { + out.suspendTabsUntilReady = out.suspendTabsUntilReady + ? 'yes' + : 'unset'; + } } } catch(ex) { diff --git a/src/js/storage.js b/src/js/storage.js index 71b5c0c09445c..a536f90ebc093 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -110,6 +110,12 @@ this.hiddenSettings[key] = hs[key]; } } + if ( typeof this.hiddenSettings.suspendTabsUntilReady === 'boolean' ) { + this.hiddenSettings.suspendTabsUntilReady = + this.hiddenSettings.suspendTabsUntilReady + ? 'yes' + : 'unset'; + } } if ( vAPI.localStorage.getItem('immediateHiddenSettings') === null ) { this.saveImmediateHiddenSettings(); diff --git a/src/js/traffic.js b/src/js/traffic.js index 372e5bd7a8662..0ddd3dfc9fb94 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -1002,8 +1002,10 @@ return { if ( vAPI.net.onBeforeReady instanceof Object && ( - vAPI.net.onBeforeReady.experimental !== true || - µBlock.hiddenSettings.suspendTabsUntilReady + vAPI.net.onBeforeReady.experimental !== true && + µBlock.hiddenSettings.suspendTabsUntilReady !== 'no' || + vAPI.net.onBeforeReady.experimental && + µBlock.hiddenSettings.suspendTabsUntilReady === 'yes' ) ) { vAPI.net.onBeforeReady.start();