mirror of https://github.com/gorhill/uBlock.git
fix #3287
This commit is contained in:
parent
0c2b715e61
commit
426d9e9db1
|
@ -547,18 +547,21 @@ vAPI.tabs.onPopupUpdated = (function() {
|
||||||
logData;
|
logData;
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/commit/1d448b85b2931412508aa01bf899e0b6f0033626#commitcomment-14944764
|
// https://github.com/gorhill/uBlock/commit/1d448b85b2931412508aa01bf899e0b6f0033626#commitcomment-14944764
|
||||||
// See if two URLs are different, disregarding scheme -- because the scheme
|
// See if two URLs are different, disregarding scheme -- because the
|
||||||
// can be unilaterally changed by the browser.
|
// scheme can be unilaterally changed by the browser.
|
||||||
var areDifferentURLs = function(a, b) {
|
|
||||||
// https://github.com/gorhill/uBlock/issues/1378
|
// https://github.com/gorhill/uBlock/issues/1378
|
||||||
// Maybe no link element was clicked.
|
// Maybe no link element was clicked.
|
||||||
|
var areDifferentURLs = function(a, b) {
|
||||||
if ( b === '' ) { return true; }
|
if ( b === '' ) { return true; }
|
||||||
|
if ( b.startsWith('about:') ) { return false; }
|
||||||
var pos = a.indexOf('://');
|
var pos = a.indexOf('://');
|
||||||
if ( pos === -1 ) { return false; }
|
if ( pos === -1 ) { return false; }
|
||||||
a = a.slice(pos);
|
a = a.slice(pos);
|
||||||
pos = b.indexOf('://');
|
pos = b.indexOf('://');
|
||||||
if ( pos === -1 ) { return false; }
|
if ( pos !== -1 ) {
|
||||||
return b.slice(pos) !== a;
|
b = b.slice(pos);
|
||||||
|
}
|
||||||
|
return b !== a;
|
||||||
};
|
};
|
||||||
|
|
||||||
var popupMatch = function(openerURL, targetURL, popupType) {
|
var popupMatch = function(openerURL, targetURL, popupType) {
|
||||||
|
|
Loading…
Reference in New Issue