From d42f72caac8c8e17efdf6d38d5d283f99bad6186 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 14 Feb 2016 11:02:43 -0500 Subject: [PATCH] #1378: oops -- this is the proper fix --- src/js/tab.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/tab.js b/src/js/tab.js index ddd01eb19..1eb331d25 100644 --- a/src/js/tab.js +++ b/src/js/tab.js @@ -524,6 +524,11 @@ vAPI.tabs.onPopupUpdated = (function() { // See if two URLs are different, disregarding scheme -- because the scheme // can be unilaterally changed by the browser. var areDifferentURLs = function(a, b) { + // https://github.com/gorhill/uBlock/issues/1378 + // Maybe no link element was clicked. + if ( b === '' ) { + return true; + } var pos = a.indexOf('://'); if ( pos === -1 ) { return false; @@ -561,7 +566,6 @@ vAPI.tabs.onPopupUpdated = (function() { // Check user switch first if ( popupType !== 'popunder' && - clickedURL !== '' && areDifferentURLs(targetURL, clickedURL) && µb.hnSwitches.evaluateZ('no-popups', openerHostname) ) {