mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 17:17:57 +01:00
filtering result has been refactored
This commit is contained in:
parent
df2db73fb1
commit
5bfe3b09a7
2 changed files with 12 additions and 1 deletions
|
@ -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 a new issue