From dbdc81aaf590a118cb1fdf6b72f46db7c5443bf9 Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 16 Aug 2016 12:12:35 -0400 Subject: [PATCH] fix #1903 --- src/js/tab.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/js/tab.js b/src/js/tab.js index 21773044d..4843f3c21 100644 --- a/src/js/tab.js +++ b/src/js/tab.js @@ -644,9 +644,16 @@ vAPI.tabs.onPopupUpdated = (function() { return ''; } // https://github.com/gorhill/uBlock/issues/1471 - // We test whether the opener hostname as at least one character - // within matched portion of URL. - return beg < pos + popunderHostname.length && end > pos ? result : ''; + // We test whether the opener hostname as at least one character + // within matched portion of URL. + // https://github.com/gorhill/uBlock/issues/1903 + // Ignore filters which cause a match before the start of the + // hostname in the URL. + return beg >= pos && + beg < pos + popunderHostname.length && + end > pos ? + result : + ''; }; var popunderMatch = function(openerURL, targetURL) {