filtering result has been refactored

This commit is contained in:
gorhill 2015-01-01 10:55:00 -05:00
parent df2db73fb1
commit 5bfe3b09a7
2 changed files with 12 additions and 1 deletions

View file

@ -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;
}

View file

@ -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';
};
/******************************************************************************/
})();