From 3537e9d3c0cbd84e7af14627dd0b10f97d86032a Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 19 Jan 2022 09:16:01 -0500 Subject: [PATCH] Disable the suspending of network requests when installing the extension Related feedback: - https://www.reddit.com/r/uBlockOrigin/comments/s7c9go/page_automatically_refreshes_after_installation/ --- src/js/start.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/js/start.js b/src/js/start.js index 2702973ea..623ec3bd3 100644 --- a/src/js/start.js +++ b/src/js/start.js @@ -134,6 +134,9 @@ const initializeTabs = async function() { /******************************************************************************/ // To bring older versions up to date +// +// https://www.reddit.com/r/uBlockOrigin/comments/s7c9go/ +// Abort suspending network requests when uBO is merely being installed. const onVersionReady = function(lastVersion) { if ( lastVersion === vAPI.app.version ) { return; } @@ -141,7 +144,12 @@ const onVersionReady = function(lastVersion) { vAPI.storage.set({ version: vAPI.app.version }); const lastVersionInt = vAPI.app.intFromVersion(lastVersion); - if ( lastVersionInt === 0 ) { return; } + + // Special case: first installation + if ( lastVersionInt === 0 ) { + vAPI.net.unsuspend({ all: true, discard: true }); + return; + } // Since built-in resources may have changed since last version, we // force a reload of all resources.