mirror of https://github.com/gorhill/uBlock.git
this fixes #838
This commit is contained in:
parent
2ca410452e
commit
0b0b88684a
|
@ -81,8 +81,9 @@ vAPI.shutdown = (function() {
|
||||||
}
|
}
|
||||||
var filters = self.rpc({
|
var filters = self.rpc({
|
||||||
fnName: 'getScriptTagFilters',
|
fnName: 'getScriptTagFilters',
|
||||||
url: location.href,
|
rootURL: self.top.location.href,
|
||||||
hostname: hostname
|
frameURL: self.location.href,
|
||||||
|
frameHostname: hostname
|
||||||
});
|
});
|
||||||
if ( typeof filters !== 'string' || filters === '' ) {
|
if ( typeof filters !== 'string' || filters === '' ) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -38,12 +38,21 @@ if ( typeof vAPI.rpcReceiver !== 'object' ) {
|
||||||
vAPI.rpcReceiver.getScriptTagFilters = function(details) {
|
vAPI.rpcReceiver.getScriptTagFilters = function(details) {
|
||||||
var µb = µBlock;
|
var µb = µBlock;
|
||||||
var cfe = µb.cosmeticFilteringEngine;
|
var cfe = µb.cosmeticFilteringEngine;
|
||||||
if ( !cfe ) { return; }
|
if ( !cfe ) {
|
||||||
var hostname = details.hostname;
|
return;
|
||||||
return cfe.retrieveScriptTagRegex(
|
}
|
||||||
|
// Fetching the script tag filters first: assuming it is faster than
|
||||||
|
// checking whether the site is whitelisted.
|
||||||
|
var hostname = details.frameHostname;
|
||||||
|
var r = cfe.retrieveScriptTagRegex(
|
||||||
µb.URI.domainFromHostname(hostname) || hostname,
|
µb.URI.domainFromHostname(hostname) || hostname,
|
||||||
hostname
|
hostname
|
||||||
);
|
);
|
||||||
|
// https://github.com/gorhill/uBlock/issues/838
|
||||||
|
// Disable script tag filtering if document URL is whitelisted.
|
||||||
|
if ( r !== undefined && µb.getNetFilteringSwitch(details.rootURL) ) {
|
||||||
|
return r;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue