mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01:00
Support disabling suspendTabsUntilReady
in Firefox
The value of `suspendTabsUntilReady` was disregarded in Firefox and uBO defaulted to always defer tab loading until it was ready. This commit allows to disable the deferring of tab loading in Firefox. The new valid values for `suspendTabsUntilReady` are: - `unset`: leave it to the platform to pick the optimal behavior (default) - `no`: do no suspend tab loading at launch time - `yes`: suspend tab loading at launch time
This commit is contained in:
parent
928ab91ab8
commit
87feb47b51
@ -53,7 +53,7 @@ const µBlock = (function() { // jshint ignore:line
|
|||||||
requestJournalProcessPeriod: 1000,
|
requestJournalProcessPeriod: 1000,
|
||||||
selfieAfter: 11,
|
selfieAfter: 11,
|
||||||
strictBlockingBypassDuration: 120,
|
strictBlockingBypassDuration: 120,
|
||||||
suspendTabsUntilReady: false,
|
suspendTabsUntilReady: 'unset',
|
||||||
userResourcesLocation: 'unset'
|
userResourcesLocation: 'unset'
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -104,6 +104,11 @@ const µBlock = (function() { // jshint ignore:line
|
|||||||
if ( out.hasOwnProperty(k) ) { out[k] = o[k]; }
|
if ( out.hasOwnProperty(k) ) { out[k] = o[k]; }
|
||||||
}
|
}
|
||||||
self.log.verbosity = out.consoleLogLevel;
|
self.log.verbosity = out.consoleLogLevel;
|
||||||
|
if ( typeof out.suspendTabsUntilReady === 'boolean' ) {
|
||||||
|
out.suspendTabsUntilReady = out.suspendTabsUntilReady
|
||||||
|
? 'yes'
|
||||||
|
: 'unset';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(ex) {
|
catch(ex) {
|
||||||
|
@ -110,6 +110,12 @@
|
|||||||
this.hiddenSettings[key] = hs[key];
|
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 ) {
|
if ( vAPI.localStorage.getItem('immediateHiddenSettings') === null ) {
|
||||||
this.saveImmediateHiddenSettings();
|
this.saveImmediateHiddenSettings();
|
||||||
|
@ -1002,8 +1002,10 @@ return {
|
|||||||
if (
|
if (
|
||||||
vAPI.net.onBeforeReady instanceof Object &&
|
vAPI.net.onBeforeReady instanceof Object &&
|
||||||
(
|
(
|
||||||
vAPI.net.onBeforeReady.experimental !== true ||
|
vAPI.net.onBeforeReady.experimental !== true &&
|
||||||
µBlock.hiddenSettings.suspendTabsUntilReady
|
µBlock.hiddenSettings.suspendTabsUntilReady !== 'no' ||
|
||||||
|
vAPI.net.onBeforeReady.experimental &&
|
||||||
|
µBlock.hiddenSettings.suspendTabsUntilReady === 'yes'
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
vAPI.net.onBeforeReady.start();
|
vAPI.net.onBeforeReady.start();
|
||||||
|
Loading…
Reference in New Issue
Block a user