Tabs opened from about:newtab are not popup candidates

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1184
This commit is contained in:
Raymond Hill 2020-07-29 07:13:08 -04:00
parent 188ccb4a04
commit 3632c1821e
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 11 additions and 0 deletions

View File

@ -513,6 +513,10 @@ housekeep itself.
}
};
// https://github.com/uBlockOrigin/uBlock-issues/issues/1184
// Do not consider a tab opened from `about:newtab` to be a popup
// candidate.
const onTabCreated = async function(createDetails) {
const { sourceTabId, sourceFrameId, tabId } = createDetails;
const popup = popupCandidates.get(tabId);
@ -533,6 +537,13 @@ housekeep itself.
catch (reason) {
return;
}
if (
Array.isArray(openerDetails) === false ||
openerDetails.length !== 2 ||
openerDetails[1].url === 'about:newtab'
) {
return;
}
popupCandidates.set(
tabId,
new PopupCandidate(createDetails, openerDetails)