1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-03 17:49:39 +02:00

Also test legitimacy of popup tab against last clicked link

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1912

Related commit:
- 7713597e3e

In above related commit, uBO was modified to cache the URL of the
last clicked link, and to use this cached URL to test for the
legitimacy of the newly opened tab.

The current commit add back a test against the URL of the last
clicked link to avoid false positives when navigating from within
the newly opened tab.
This commit is contained in:
Raymond Hill 2021-12-31 14:18:16 -05:00
parent be1d2c5420
commit c8c144b663
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -355,8 +355,14 @@ const onPopupUpdated = (( ) => {
let popupType = 'popup',
result = 0;
// https://github.com/gorhill/uBlock/issues/2919
// - If the target tab matches a clicked link, assume it's legit.
if ( areDifferentURLs(targetURL, openerDetails.trustedURL) ) {
// If the target tab matches a clicked link, assume it's legit.
// https://github.com/uBlockOrigin/uBlock-issues/issues/1912
// If the target also matches the last clicked link, assume it's
// legit.
if (
areDifferentURLs(targetURL, openerDetails.trustedURL) &&
areDifferentURLs(targetURL, µb.maybeGoodPopup.url)
) {
result = popupMatch(fctxt, rootOpenerURL, localOpenerURL, targetURL);
}