1
0
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:
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';
};
/******************************************************************************/
})();