mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
Report unprocessed network request count in troubleshooting info
Related discussion: - https://github.com/uBlockOrigin/uAssets/discussions/16939
This commit is contained in:
parent
0c9576d3e6
commit
f9b03ebeac
4 changed files with 10 additions and 5 deletions
|
@ -1175,6 +1175,7 @@ vAPI.Net = class {
|
|||
this.suspendableListener = undefined;
|
||||
this.listenerMap = new WeakMap();
|
||||
this.suspendDepth = 0;
|
||||
this.unprocessedRequestCount = 0;
|
||||
|
||||
browser.webRequest.onBeforeRequest.addListener(
|
||||
details => {
|
||||
|
@ -1227,8 +1228,10 @@ vAPI.Net = class {
|
|||
);
|
||||
}
|
||||
onBeforeSuspendableRequest(details) {
|
||||
if ( this.suspendableListener === undefined ) { return; }
|
||||
return this.suspendableListener(details);
|
||||
if ( this.suspendableListener !== undefined ) {
|
||||
return this.suspendableListener(details);
|
||||
}
|
||||
this.unprocessedRequestCount += 1;
|
||||
}
|
||||
setSuspendableListener(listener) {
|
||||
this.suspendableListener = listener;
|
||||
|
|
|
@ -560,7 +560,7 @@ const assetCacheRead = async function(assetKey, updateReadTime = false) {
|
|||
|
||||
µb.supportStats.maxAssetCacheWait = Math.max(
|
||||
Date.now() - t0,
|
||||
parseInt(µb.supportStats.maxAssetCacheWait, 10)
|
||||
parseInt(µb.supportStats.maxAssetCacheWait, 10) || 0
|
||||
) + ' ms';
|
||||
|
||||
if (
|
||||
|
|
|
@ -219,8 +219,9 @@ const µBlock = { // jshint ignore:line
|
|||
readyToFilter: false,
|
||||
|
||||
supportStats: {
|
||||
allReadyAfter: '',
|
||||
maxAssetCacheWait: '0 ms',
|
||||
allReadyAfter: '?',
|
||||
maxAssetCacheWait: '?',
|
||||
unprocessedRequestCount: '?',
|
||||
},
|
||||
|
||||
pageStores: new Map(),
|
||||
|
|
|
@ -1147,6 +1147,7 @@ const webRequest = {
|
|||
}
|
||||
);
|
||||
vAPI.net.unsuspend({ all: true });
|
||||
µb.supportStats.unprocessedRequestCount = `${vAPI.net.unprocessedRequestCount}`;
|
||||
};
|
||||
})(),
|
||||
|
||||
|
|
Loading…
Reference in a new issue