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.suspendableListener = undefined;
|
||||||
this.listenerMap = new WeakMap();
|
this.listenerMap = new WeakMap();
|
||||||
this.suspendDepth = 0;
|
this.suspendDepth = 0;
|
||||||
|
this.unprocessedRequestCount = 0;
|
||||||
|
|
||||||
browser.webRequest.onBeforeRequest.addListener(
|
browser.webRequest.onBeforeRequest.addListener(
|
||||||
details => {
|
details => {
|
||||||
|
@ -1227,8 +1228,10 @@ vAPI.Net = class {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
onBeforeSuspendableRequest(details) {
|
onBeforeSuspendableRequest(details) {
|
||||||
if ( this.suspendableListener === undefined ) { return; }
|
if ( this.suspendableListener !== undefined ) {
|
||||||
return this.suspendableListener(details);
|
return this.suspendableListener(details);
|
||||||
|
}
|
||||||
|
this.unprocessedRequestCount += 1;
|
||||||
}
|
}
|
||||||
setSuspendableListener(listener) {
|
setSuspendableListener(listener) {
|
||||||
this.suspendableListener = listener;
|
this.suspendableListener = listener;
|
||||||
|
|
|
@ -560,7 +560,7 @@ const assetCacheRead = async function(assetKey, updateReadTime = false) {
|
||||||
|
|
||||||
µb.supportStats.maxAssetCacheWait = Math.max(
|
µb.supportStats.maxAssetCacheWait = Math.max(
|
||||||
Date.now() - t0,
|
Date.now() - t0,
|
||||||
parseInt(µb.supportStats.maxAssetCacheWait, 10)
|
parseInt(µb.supportStats.maxAssetCacheWait, 10) || 0
|
||||||
) + ' ms';
|
) + ' ms';
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -219,8 +219,9 @@ const µBlock = { // jshint ignore:line
|
||||||
readyToFilter: false,
|
readyToFilter: false,
|
||||||
|
|
||||||
supportStats: {
|
supportStats: {
|
||||||
allReadyAfter: '',
|
allReadyAfter: '?',
|
||||||
maxAssetCacheWait: '0 ms',
|
maxAssetCacheWait: '?',
|
||||||
|
unprocessedRequestCount: '?',
|
||||||
},
|
},
|
||||||
|
|
||||||
pageStores: new Map(),
|
pageStores: new Map(),
|
||||||
|
|
|
@ -1147,6 +1147,7 @@ const webRequest = {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
vAPI.net.unsuspend({ all: true });
|
vAPI.net.unsuspend({ all: true });
|
||||||
|
µb.supportStats.unprocessedRequestCount = `${vAPI.net.unprocessedRequestCount}`;
|
||||||
};
|
};
|
||||||
})(),
|
})(),
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue