Use the warning toolbar icon only if unprocessed requests

Related discussion:
- https://github.com/uBlockOrigin/uAssets/discussions/16939

Related commit:
- 0c9576d3e6
This commit is contained in:
Raymond Hill 2023-03-15 21:13:28 -04:00
parent 8e35aa74f0
commit 39cac612c2
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 6 additions and 4 deletions

View File

@ -1231,10 +1231,16 @@ vAPI.Net = class {
if ( this.suspendableListener !== undefined ) { if ( this.suspendableListener !== undefined ) {
return this.suspendableListener(details); return this.suspendableListener(details);
} }
if ( this.unprocessedRequestCount === 0 ) {
vAPI.setDefaultIcon('-loading');
}
this.unprocessedRequestCount += 1; this.unprocessedRequestCount += 1;
} }
setSuspendableListener(listener) { setSuspendableListener(listener) {
this.suspendableListener = listener; this.suspendableListener = listener;
if ( this.unprocessedRequestCount !== 0 ) {
vAPI.setDefaultIcon('');
}
} }
removeListener(which, clientListener) { removeListener(which, clientListener) {
const actualListener = this.listenerMap.get(clientListener); const actualListener = this.listenerMap.get(clientListener);

View File

@ -29,8 +29,6 @@ import './vapi-common.js';
import './vapi-background.js'; import './vapi-background.js';
import './vapi-background-ext.js'; import './vapi-background-ext.js';
vAPI.setDefaultIcon('-loading'); // Do this as soon as possible
/******************************************************************************/ /******************************************************************************/
// The following modules are loaded here until their content is better organized // The following modules are loaded here until their content is better organized
@ -462,8 +460,6 @@ if ( selfieIsValid !== true ) {
// This can be used to defer filtering decision-making. // This can be used to defer filtering decision-making.
µb.readyToFilter = true; µb.readyToFilter = true;
vAPI.setDefaultIcon('');
// Start network observers. // Start network observers.
webRequest.start(); webRequest.start();