From b9e055c0e16ba6b449724bc1d7f4aa276e80d3c8 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 12 Apr 2023 10:55:00 -0400 Subject: [PATCH] More aggressively clear the unprocessed-request status Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/2589 --- platform/common/vapi-background.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/common/vapi-background.js b/platform/common/vapi-background.js index e65e1fe84..4f72f5bfc 100644 --- a/platform/common/vapi-background.js +++ b/platform/common/vapi-background.js @@ -1305,8 +1305,11 @@ vAPI.Net = class { return this.unprocessedTabs.size !== 0 && this.unprocessedTabs.has(tabId); } - removeUnprocessedRequest(tabId) { - this.unprocessedTabs.delete(tabId); + // https://github.com/uBlockOrigin/uBlock-issues/issues/2589 + // - Aggressively clear the unprocessed-request status of all tabs as + // soon as there is a call to clear for one tab. + removeUnprocessedRequest() { + this.unprocessedTabs.clear(); if ( this.unprocessedTabs.size !== 0 ) { return false; } this.suspendableListener = this.deferredSuspendableListener; this.deferredSuspendableListener = undefined;