mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
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.requestType = 'inline-script';
|
||||
var result = pageStore.filterRequest(pageStore);
|
||||
if ( result === '' ) {
|
||||
if ( µb.isAllowResult(result) ) {
|
||||
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
Block a user