mirror of https://github.com/gorhill/uBlock.git
This commit is contained in:
parent
4648cbdb69
commit
1d7e3e8f82
|
@ -84,8 +84,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ( details.documentUrl !== undefined ) {
|
} else if ( details.documentUrl !== undefined ) {
|
||||||
this.setTabOriginFromURL(details.documentUrl);
|
const normalURL = µBlock.normalizePageURL(0, details.documentUrl);
|
||||||
this.setDocOriginFromURL(details.documentUrl);
|
this.setTabOriginFromURL(normalURL);
|
||||||
|
this.setDocOriginFromURL(normalURL);
|
||||||
} else {
|
} else {
|
||||||
this.setDocOrigin(this.tabOrigin);
|
this.setDocOrigin(this.tabOrigin);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,16 +46,16 @@ var µb = µBlock;
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
µb.normalizePageURL = function(tabId, pageURL) {
|
µb.normalizePageURL = function(tabId, pageURL) {
|
||||||
if ( vAPI.isBehindTheSceneTabId(tabId) ) {
|
if ( tabId < 0 ) {
|
||||||
return 'http://behind-the-scene/';
|
return 'http://behind-the-scene/';
|
||||||
}
|
}
|
||||||
var uri = this.URI.set(pageURL);
|
const uri = this.URI.set(pageURL);
|
||||||
var scheme = uri.scheme;
|
const scheme = uri.scheme;
|
||||||
if ( scheme === 'https' || scheme === 'http' ) {
|
if ( scheme === 'https' || scheme === 'http' ) {
|
||||||
return uri.normalizedURI();
|
return uri.normalizedURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
var fakeHostname = scheme + '-scheme';
|
let fakeHostname = scheme + '-scheme';
|
||||||
|
|
||||||
if ( uri.hostname !== '' ) {
|
if ( uri.hostname !== '' ) {
|
||||||
fakeHostname = uri.hostname + '.' + fakeHostname;
|
fakeHostname = uri.hostname + '.' + fakeHostname;
|
||||||
|
|
|
@ -284,7 +284,7 @@ const onBeforeBehindTheSceneRequest = function(fctxt) {
|
||||||
let result = 0;
|
let result = 0;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
µb.URI.isNetworkURI(fctxt.docOrigin) ||
|
µb.URI.isNetworkURI(fctxt.tabOrigin) ||
|
||||||
µb.userSettings.advancedUserEnabled ||
|
µb.userSettings.advancedUserEnabled ||
|
||||||
fctxt.type === 'csp_report'
|
fctxt.type === 'csp_report'
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -410,7 +410,7 @@ URI.isNetworkURI = function(uri) {
|
||||||
return reNetworkURI.test(uri);
|
return reNetworkURI.test(uri);
|
||||||
};
|
};
|
||||||
|
|
||||||
var reNetworkURI = /^(?:ftps?|https?|wss?):\/\//;
|
const reNetworkURI = /^(?:ftps?|https?|wss?):\/\//;
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ URI.isNetworkScheme = function(scheme) {
|
||||||
return reNetworkScheme.test(scheme);
|
return reNetworkScheme.test(scheme);
|
||||||
};
|
};
|
||||||
|
|
||||||
var reNetworkScheme = /^(?:ftps?|https?|wss?)$/;
|
const reNetworkScheme = /^(?:ftps?|https?|wss?)$/;
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue