mirror of https://github.com/gorhill/uBlock.git
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
|
@ -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,9 +1228,11 @@ vAPI.Net = class {
|
|||
);
|
||||
}
|
||||
onBeforeSuspendableRequest(details) {
|
||||
if ( this.suspendableListener === undefined ) { return; }
|
||||
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 New Issue