From e4d75fa025cbe25b94840f17c35acb520328bc18 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 17 Oct 2021 12:55:31 -0400 Subject: [PATCH] Ignore unused tabs.onUpdated() events --- platform/common/vapi-background.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/common/vapi-background.js b/platform/common/vapi-background.js index cf1f76131..da7a584ad 100644 --- a/platform/common/vapi-background.js +++ b/platform/common/vapi-background.js @@ -524,9 +524,12 @@ vAPI.Tabs = class { } onUpdatedHandler(tabId, changeInfo, tab) { + // Ignore uninteresting update events + const { status = '', title = '', url = '' } = changeInfo; + if ( status === '' && title === '' && url === '' ) { return; } // https://github.com/gorhill/uBlock/issues/3073 // Fall back to `tab.url` when `changeInfo.url` is not set. - if ( typeof changeInfo.url !== 'string' ) { + if ( url === '' ) { changeInfo.url = tab && tab.url; } if ( changeInfo.url ) {