From 426d9e9db14bd7ecf2384974c7796ed41de0450f Mon Sep 17 00:00:00 2001 From: gorhill Date: Mon, 27 Nov 2017 14:48:01 -0500 Subject: [PATCH] fix #3287 --- src/js/tab.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/js/tab.js b/src/js/tab.js index e010d9e7f..e4b339ec9 100644 --- a/src/js/tab.js +++ b/src/js/tab.js @@ -547,18 +547,21 @@ vAPI.tabs.onPopupUpdated = (function() { logData; // https://github.com/gorhill/uBlock/commit/1d448b85b2931412508aa01bf899e0b6f0033626#commitcomment-14944764 - // See if two URLs are different, disregarding scheme -- because the scheme - // can be unilaterally changed by the browser. + // See if two URLs are different, disregarding scheme -- because the + // scheme can be unilaterally changed by the browser. + // https://github.com/gorhill/uBlock/issues/1378 + // Maybe no link element was clicked. var areDifferentURLs = function(a, b) { - // https://github.com/gorhill/uBlock/issues/1378 - // Maybe no link element was clicked. if ( b === '' ) { return true; } + if ( b.startsWith('about:') ) { return false; } var pos = a.indexOf('://'); if ( pos === -1 ) { return false; } a = a.slice(pos); pos = b.indexOf('://'); - if ( pos === -1 ) { return false; } - return b.slice(pos) !== a; + if ( pos !== -1 ) { + b = b.slice(pos); + } + return b !== a; }; var popupMatch = function(openerURL, targetURL, popupType) {