mirror of https://github.com/gorhill/uBlock.git
filtering result has been refactored
This commit is contained in:
parent
df2db73fb1
commit
5bfe3b09a7
|
@ -260,7 +260,7 @@ var onHeadersReceived = function(details) {
|
||||||
pageStore.requestHostname = µb.URI.hostnameFromURI(details.url);
|
pageStore.requestHostname = µb.URI.hostnameFromURI(details.url);
|
||||||
pageStore.requestType = 'inline-script';
|
pageStore.requestType = 'inline-script';
|
||||||
var result = pageStore.filterRequest(pageStore);
|
var result = pageStore.filterRequest(pageStore);
|
||||||
if ( result === '' ) {
|
if ( µb.isAllowResult(result) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -394,4 +394,15 @@ var matchWhitelistDirective = function(url, hostname, directive) {
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
µBlock.isBlockResult = function(result) {
|
||||||
|
return typeof result === 'string' && result.charAt(1) === 'b';
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
µBlock.isAllowResult = function(result) {
|
||||||
|
return typeof result !== 'string' || result.charAt(1) !== 'b';
|
||||||
|
};
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
})();
|
})();
|
Loading…
Reference in New Issue