1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-15 07:22:28 +02:00

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

View File

@ -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.