mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01:00
fix #3060
This commit is contained in:
parent
ab1e5d350e
commit
d73b888150
@ -577,7 +577,13 @@ vAPI.tabs.onPopupUpdated = (function() {
|
|||||||
// URL.
|
// URL.
|
||||||
if ( openerHostname !== '' && targetURL !== 'about:blank' ) {
|
if ( openerHostname !== '' && targetURL !== 'about:blank' ) {
|
||||||
// Check per-site switch first
|
// Check per-site switch first
|
||||||
if ( µb.hnSwitches.evaluateZ('no-popups', openerHostname) === true ) {
|
// https://github.com/gorhill/uBlock/issues/3060
|
||||||
|
// - The no-popups switch must apply only to popups, not to
|
||||||
|
// popunders.
|
||||||
|
if (
|
||||||
|
popupType === 'popup' &&
|
||||||
|
µb.hnSwitches.evaluateZ('no-popups', openerHostname)
|
||||||
|
) {
|
||||||
logData = {
|
logData = {
|
||||||
source: 'switch',
|
source: 'switch',
|
||||||
raw: 'no-popups: ' + µb.hnSwitches.z + ' true'
|
raw: 'no-popups: ' + µb.hnSwitches.z + ' true'
|
||||||
@ -586,9 +592,13 @@ vAPI.tabs.onPopupUpdated = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/issues/581
|
// https://github.com/gorhill/uBlock/issues/581
|
||||||
// Take into account popup-specific rules in dynamic URL filtering, OR
|
// Take into account popup-specific rules in dynamic URL
|
||||||
// generic allow rules.
|
// filtering, OR generic allow rules.
|
||||||
result = µb.sessionURLFiltering.evaluateZ(openerHostname, targetURL, popupType);
|
result = µb.sessionURLFiltering.evaluateZ(
|
||||||
|
openerHostname,
|
||||||
|
targetURL,
|
||||||
|
popupType
|
||||||
|
);
|
||||||
if (
|
if (
|
||||||
result === 1 && µb.sessionURLFiltering.type === popupType ||
|
result === 1 && µb.sessionURLFiltering.type === popupType ||
|
||||||
result === 2
|
result === 2
|
||||||
@ -598,10 +608,14 @@ vAPI.tabs.onPopupUpdated = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/issues/581
|
// https://github.com/gorhill/uBlock/issues/581
|
||||||
// Take into account `allow` rules in dynamic filtering: `block` rules
|
// Take into account `allow` rules in dynamic filtering: `block`
|
||||||
// are ignored, as block rules are not meant to block specific types
|
// rules are ignored, as block rules are not meant to block
|
||||||
// like `popup` (just like with static filters).
|
// specific types like `popup` (just like with static filters).
|
||||||
result = µb.sessionFirewall.evaluateCellZY(openerHostname, context.requestHostname, popupType);
|
result = µb.sessionFirewall.evaluateCellZY(
|
||||||
|
openerHostname,
|
||||||
|
context.requestHostname,
|
||||||
|
popupType
|
||||||
|
);
|
||||||
if ( result === 2 ) {
|
if ( result === 2 ) {
|
||||||
logData = µb.sessionFirewall.toLogData();
|
logData = µb.sessionFirewall.toLogData();
|
||||||
return 2;
|
return 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user