Fix report of unprocessed requests in Support pane

This commit is contained in:
Raymond Hill 2023-03-18 16:20:40 -04:00
parent d42e9ae2a8
commit e8abd5dfbe
No known key found for this signature in database
GPG key ID: 25E1490B761470C2
4 changed files with 5 additions and 4 deletions

View file

@ -220,7 +220,6 @@ const µBlock = { // jshint ignore:line
supportStats: {
allReadyAfter: '?',
maxAssetCacheWait: '?',
unprocessedRequestCount: '?',
},
pageStores: new Map(),

View file

@ -626,9 +626,12 @@ const onMessage = function(request, sender, callback) {
case 'launchReporter': {
const pageStore = µb.pageStoreFromTabId(request.tabId);
if ( pageStore === null ) { break; }
if ( vAPI.net.hasUnprocessedRequest(request.tabId) ) {
request.popupPanel.hasUnprocessedRequest = true;
}
const supportURL = new URL(vAPI.getURL('support.html'));
supportURL.searchParams.set('pageURL', request.pageURL);
supportURL.searchParams.set('popupPanel', request.popupPanel);
supportURL.searchParams.set('popupPanel', JSON.stringify(request.popupPanel));
µb.openNewTab({ url: supportURL.href, select: true, index: -1 });
break;
}

View file

@ -859,7 +859,7 @@ const gotoReport = function() {
what: 'launchReporter',
tabId: popupData.tabId,
pageURL: popupData.pageURL,
popupPanel: JSON.stringify(popupPanel),
popupPanel,
});
vAPI.closePopup();

View file

@ -1147,7 +1147,6 @@ const webRequest = {
}
);
vAPI.net.unsuspend({ all: true });
µb.supportStats.unprocessedRequestCount = `${vAPI.net.unprocessedRequestCount}`;
};
})(),