mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01:00
Let the platform pick the default suspend state at launch
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1004 The fix is trivial enough that I feel confident to make it part of current RC cycle. There are many reports of block page at launch on Chromium. The fix is to let the platform pick it's natural suspend state rather than force it. Once advanced settings are read, the suspend state will for toggled only if `suspendTabsUntilReady` is either `yes` or `no`. This there should no longer be blocked page on Chromium at launch when using default settings. Related feedback: - https://www.reddit.com/r/uBlockOrigin/comments/gac2h8/
This commit is contained in:
parent
e59ec0cdd0
commit
80b758e18d
@ -268,15 +268,11 @@ try {
|
|||||||
await µb.loadHiddenSettings();
|
await µb.loadHiddenSettings();
|
||||||
log.info(`Hidden settings ready ${Date.now()-vAPI.T0} ms after launch`);
|
log.info(`Hidden settings ready ${Date.now()-vAPI.T0} ms after launch`);
|
||||||
|
|
||||||
// By default network requests are always suspended, so we must
|
// Maybe override current network listener suspend state
|
||||||
// unsuspend immediately if commanded by platform + advanced settings.
|
if ( µb.hiddenSettings.suspendTabsUntilReady === 'no' ) {
|
||||||
if (
|
|
||||||
vAPI.net.canSuspend() &&
|
|
||||||
µb.hiddenSettings.suspendTabsUntilReady === 'no' ||
|
|
||||||
vAPI.net.canSuspend() !== true &&
|
|
||||||
µb.hiddenSettings.suspendTabsUntilReady !== 'yes'
|
|
||||||
) {
|
|
||||||
vAPI.net.unsuspend(true);
|
vAPI.net.unsuspend(true);
|
||||||
|
} else if ( µb.hiddenSettings.suspendTabsUntilReady === 'yes' ) {
|
||||||
|
vAPI.net.suspend();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( µb.hiddenSettings.disableWebAssembly !== true ) {
|
if ( µb.hiddenSettings.disableWebAssembly !== true ) {
|
||||||
|
@ -1035,7 +1035,7 @@ const strictBlockBypasser = {
|
|||||||
return {
|
return {
|
||||||
start: (( ) => {
|
start: (( ) => {
|
||||||
vAPI.net = new vAPI.Net();
|
vAPI.net = new vAPI.Net();
|
||||||
vAPI.net.suspend(true);
|
vAPI.net.suspend();
|
||||||
|
|
||||||
return function() {
|
return function() {
|
||||||
vAPI.net.setSuspendableListener(onBeforeRequest);
|
vAPI.net.setSuspendableListener(onBeforeRequest);
|
||||||
|
Loading…
Reference in New Issue
Block a user