From 59f4aca0106fec350842c862d1958ff602070394 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Tue, 22 Apr 2025 09:34:26 -0400 Subject: [PATCH] Exclude `chrome:` as valid openers for popup candidates Related issue: https://github.com/uBlockOrigin/uBlock-issues/issues/2227 --- src/js/tab.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/js/tab.js b/src/js/tab.js index 1bf65912d..743ea6b62 100644 --- a/src/js/tab.js +++ b/src/js/tab.js @@ -573,14 +573,12 @@ housekeep itself. } catch { return; } - if ( - Array.isArray(openerDetails) === false || - openerDetails.length !== 2 || - openerDetails[1] === null || - openerDetails[1].url === 'about:newtab' - ) { - return; - } + if ( Array.isArray(openerDetails) === false ) { return; } + if ( openerDetails.length !== 2 ) { return; } + if ( openerDetails[1] === null ) { return; } + if ( openerDetails[1].url === 'about:newtab' ) { return; } + // https://github.com/uBlockOrigin/uBlock-issues/issues/2227 + if ( openerDetails[1].url.startsWith('chrome:') ) { return; } popupCandidates.set( tabId, new PopupCandidate(createDetails, openerDetails)