This commit is contained in:
gorhill 2017-11-27 14:48:01 -05:00
parent 0c2b715e61
commit 426d9e9db1
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 9 additions and 6 deletions

View File

@ -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) {