@@ -516,7 +516,7 @@ vAPI.tabs.onPopupUpdated = (function() {
516516 // remember whether a popup or popunder was matched.
517517 var context = { } ;
518518
519- var popupMatch = function ( openerURL , targetURL , clickedURL , popunder ) {
519+ var popupMatch = function ( openerURL , targetURL , clickedURL , popupType ) {
520520 var openerHostname = µb . URI . hostnameFromURI ( openerURL ) ;
521521 var openerDomain = µb . URI . domainFromHostname ( openerHostname ) ;
522522
@@ -533,7 +533,7 @@ vAPI.tabs.onPopupUpdated = (function() {
533533 if ( openerHostname !== '' ) {
534534 // Check user switch first
535535 if (
536- popunder !== true &&
536+ popupType !== 'popunder' &&
537537 targetURL !== clickedURL &&
538538 µb . hnSwitches . evaluateZ ( 'no-popups' , openerHostname )
539539 ) {
@@ -543,9 +543,9 @@ vAPI.tabs.onPopupUpdated = (function() {
543543 // https://github.com/gorhill/uBlock/issues/581
544544 // Take into account popup-specific rules in dynamic URL filtering, OR
545545 // generic allow rules.
546- µb . sessionURLFiltering . evaluateZ ( openerHostname , targetURL , 'popup' ) ;
546+ µb . sessionURLFiltering . evaluateZ ( openerHostname , targetURL , popupType ) ;
547547 if (
548- µb . sessionURLFiltering . r === 1 && µb . sessionURLFiltering . type === 'popup' ||
548+ µb . sessionURLFiltering . r === 1 && µb . sessionURLFiltering . type === popupType ||
549549 µb . sessionURLFiltering . r === 2
550550 ) {
551551 return µb . sessionURLFiltering . toFilterString ( ) ;
@@ -555,7 +555,7 @@ vAPI.tabs.onPopupUpdated = (function() {
555555 // Take into account `allow` rules in dynamic filtering: `block` rules
556556 // are ignored, as block rules are not meant to block specific types
557557 // like `popup` (just like with static filters).
558- µb . sessionFirewall . evaluateCellZY ( openerHostname , context . requestHostname , 'popup' ) ;
558+ µb . sessionFirewall . evaluateCellZY ( openerHostname , context . requestHostname , popupType ) ;
559559 if ( µb . sessionFirewall . r === 2 ) {
560560 return µb . sessionFirewall . toFilterString ( ) ;
561561 }
@@ -566,7 +566,7 @@ vAPI.tabs.onPopupUpdated = (function() {
566566 // Don't block if uBlock is turned off in popup's context
567567 if (
568568 µb . getNetFilteringSwitch ( targetURL ) &&
569- µb . staticNetFilteringEngine . matchStringExactType ( context , targetURL , 'popup' ) !== undefined
569+ µb . staticNetFilteringEngine . matchStringExactType ( context , targetURL , popupType ) !== undefined
570570 ) {
571571 return µb . staticNetFilteringEngine . toResultString ( µb . logger . isEnabled ( ) ) ;
572572 }
@@ -603,12 +603,15 @@ vAPI.tabs.onPopupUpdated = (function() {
603603 }
604604
605605 // Popup test.
606- var result = popupMatch ( openerURL , targetURL , µb . mouseURL ) ;
606+ var popupType = 'popup' ;
607+ var result = popupMatch ( openerURL , targetURL , µb . mouseURL , popupType ) ;
607608
608609 // Popunder test.
609610 if ( result === '' ) {
610611 var tmp = openerTabId ; openerTabId = targetTabId ; targetTabId = tmp ;
611- result = popupMatch ( targetURL , openerURL , µb . mouseURL , true ) ;
612+ popupType = 'popunder' ;
613+ result = popupMatch ( targetURL , openerURL , µb . mouseURL , popupType ) ;
614+ console . log ( 'vAPI.tabs.onPopupUpdated: %s => %s (%s)' , targetURL , openerURL , popupType ) ;
612615 }
613616
614617 // Log only for when there was a hit against an actual filter (allow or block).
@@ -617,7 +620,7 @@ vAPI.tabs.onPopupUpdated = (function() {
617620 openerTabId ,
618621 'net' ,
619622 result ,
620- 'popup' ,
623+ popupType ,
621624 context . requestURL ,
622625 µb . URI . hostnameFromURI ( context . rootURL ) ,
623626 µb . URI . hostnameFromURI ( context . rootURL )
0 commit comments