From 1d448b85b2931412508aa01bf899e0b6f0033626 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 13 Dec 2015 00:16:35 -0500 Subject: [PATCH] fine tuning popunder filtering: ignore is target URL was clicked by user --- src/js/tab.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/tab.js b/src/js/tab.js index 116df237b..0d1eede8f 100644 --- a/src/js/tab.js +++ b/src/js/tab.js @@ -606,8 +606,10 @@ vAPI.tabs.onPopupUpdated = (function() { var popupType = 'popup'; var result = popupMatch(openerURL, targetURL, µb.mouseURL, popupType); - // Popunder test. - if ( result === '' ) { + // Popunder test. Ignore if the target URL was opened by clicking on + // a link, or else this could prevent opening a legitimate site for + // which there is a very broad popunder filter. + if ( result === '' && targetURL !== µb.mouseURL ) { var tmp = openerTabId; openerTabId = targetTabId; targetTabId = tmp; popupType = 'popunder'; result = popupMatch(targetURL, openerURL, µb.mouseURL, popupType);