mirror of https://github.com/gorhill/uBlock.git
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:
parent
be1d2c5420
commit
c8c144b663
|
@ -355,8 +355,14 @@ const onPopupUpdated = (( ) => {
|
||||||
let popupType = 'popup',
|
let popupType = 'popup',
|
||||||
result = 0;
|
result = 0;
|
||||||
// https://github.com/gorhill/uBlock/issues/2919
|
// https://github.com/gorhill/uBlock/issues/2919
|
||||||
// - If the target tab matches a clicked link, assume it's legit.
|
// If the target tab matches a clicked link, assume it's legit.
|
||||||
if ( areDifferentURLs(targetURL, openerDetails.trustedURL) ) {
|
// 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);
|
result = popupMatch(fctxt, rootOpenerURL, localOpenerURL, targetURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue