1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-03 09:39:38 +02:00
This commit is contained in:
gorhill 2017-09-27 10:27:29 -04:00
parent ab1e5d350e
commit d73b888150
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -577,7 +577,13 @@ vAPI.tabs.onPopupUpdated = (function() {
// URL.
if ( openerHostname !== '' && targetURL !== 'about:blank' ) {
// 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 = {
source: 'switch',
raw: 'no-popups: ' + µb.hnSwitches.z + ' true'
@ -586,9 +592,13 @@ vAPI.tabs.onPopupUpdated = (function() {
}
// https://github.com/gorhill/uBlock/issues/581
// Take into account popup-specific rules in dynamic URL filtering, OR
// generic allow rules.
result = µb.sessionURLFiltering.evaluateZ(openerHostname, targetURL, popupType);
// Take into account popup-specific rules in dynamic URL
// filtering, OR generic allow rules.
result = µb.sessionURLFiltering.evaluateZ(
openerHostname,
targetURL,
popupType
);
if (
result === 1 && µb.sessionURLFiltering.type === popupType ||
result === 2
@ -598,10 +608,14 @@ vAPI.tabs.onPopupUpdated = (function() {
}
// https://github.com/gorhill/uBlock/issues/581
// Take into account `allow` rules in dynamic filtering: `block` rules
// are ignored, as block rules are not meant to block specific types
// like `popup` (just like with static filters).
result = µb.sessionFirewall.evaluateCellZY(openerHostname, context.requestHostname, popupType);
// Take into account `allow` rules in dynamic filtering: `block`
// rules are ignored, as block rules are not meant to block
// specific types like `popup` (just like with static filters).
result = µb.sessionFirewall.evaluateCellZY(
openerHostname,
context.requestHostname,
popupType
);
if ( result === 2 ) {
logData = µb.sessionFirewall.toLogData();
return 2;