From d73b888150c4d80c216213013d7679bb469d852a Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 27 Sep 2017 10:27:29 -0400 Subject: [PATCH] fix #3060 --- src/js/tab.js | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/js/tab.js b/src/js/tab.js index 8f6131fc5..1e87eac71 100644 --- a/src/js/tab.js +++ b/src/js/tab.js @@ -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;