Skip to content

Commit 80b758e

Browse files
committed
Let the platform pick the default suspend state at launch
Related issue: - uBlockOrigin/uBlock-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/
1 parent e59ec0c commit 80b758e

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/js/start.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,11 @@ try {
268268
await µb.loadHiddenSettings();
269269
log.info(`Hidden settings ready ${Date.now()-vAPI.T0} ms after launch`);
270270

271-
// By default network requests are always suspended, so we must
272-
// unsuspend immediately if commanded by platform + advanced settings.
273-
if (
274-
vAPI.net.canSuspend() &&
275-
µb.hiddenSettings.suspendTabsUntilReady === 'no' ||
276-
vAPI.net.canSuspend() !== true &&
277-
µb.hiddenSettings.suspendTabsUntilReady !== 'yes'
278-
) {
271+
// Maybe override current network listener suspend state
272+
if ( µb.hiddenSettings.suspendTabsUntilReady === 'no' ) {
279273
vAPI.net.unsuspend(true);
274+
} else if ( µb.hiddenSettings.suspendTabsUntilReady === 'yes' ) {
275+
vAPI.net.suspend();
280276
}
281277

282278
if ( µb.hiddenSettings.disableWebAssembly !== true ) {

src/js/traffic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ const strictBlockBypasser = {
10351035
return {
10361036
start: (( ) => {
10371037
vAPI.net = new vAPI.Net();
1038-
vAPI.net.suspend(true);
1038+
vAPI.net.suspend();
10391039

10401040
return function() {
10411041
vAPI.net.setSuspendableListener(onBeforeRequest);

0 commit comments

Comments
 (0)