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/
This commit is contained in:
Raymond Hill 2022-01-19 09:16:01 -05:00
parent d53f2362b1
commit 3537e9d3c0
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 9 additions and 1 deletions

View File

@ -134,6 +134,9 @@ const initializeTabs = async function() {
/******************************************************************************/ /******************************************************************************/
// To bring older versions up to date // 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) { const onVersionReady = function(lastVersion) {
if ( lastVersion === vAPI.app.version ) { return; } if ( lastVersion === vAPI.app.version ) { return; }
@ -141,7 +144,12 @@ const onVersionReady = function(lastVersion) {
vAPI.storage.set({ version: vAPI.app.version }); vAPI.storage.set({ version: vAPI.app.version });
const lastVersionInt = vAPI.app.intFromVersion(lastVersion); 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 // Since built-in resources may have changed since last version, we
// force a reload of all resources. // force a reload of all resources.