code review

This commit is contained in:
gorhill 2015-04-10 16:31:29 -04:00
parent 28fc4f99d4
commit 475aa5a8fc
1 changed files with 4 additions and 8 deletions

View File

@ -459,9 +459,6 @@ var tagNameToRequestTypeMap = {
var filterRequests = function(pageStore, details) { var filterRequests = function(pageStore, details) {
var requests = details.requests; var requests = details.requests;
if ( !pageStore || !pageStore.getNetFilteringSwitch() ) {
return requests;
}
if ( µb.userSettings.collapseBlocked === false ) { if ( µb.userSettings.collapseBlocked === false ) {
return requests; return requests;
} }
@ -508,10 +505,10 @@ var onMessage = function(details, sender, callback) {
switch ( details.what ) { switch ( details.what ) {
case 'retrieveGenericCosmeticSelectors': case 'retrieveGenericCosmeticSelectors':
response = { response = {
shutdown: !pageStore || pageStore.getGenericCosmeticFilteringSwitch() === false, shutdown: !pageStore || !pageStore.getNetFilteringSwitch(),
result: null result: null
}; };
if ( response.shutdown === false ) { if ( !response.shutdown && pageStore.getGenericCosmeticFilteringSwitch() ) {
response.result = µb.cosmeticFilteringEngine.retrieveGenericSelectors(details); response.result = µb.cosmeticFilteringEngine.retrieveGenericSelectors(details);
} }
break; break;
@ -520,13 +517,12 @@ var onMessage = function(details, sender, callback) {
µb.cosmeticFilteringEngine.addToSelectorCache(details); µb.cosmeticFilteringEngine.addToSelectorCache(details);
break; break;
// Evaluate many requests
case 'filterRequests': case 'filterRequests':
response = { response = {
shutdown: !pageStore || pageStore.getGenericCosmeticFilteringSwitch() === false, shutdown: !pageStore || !pageStore.getNetFilteringSwitch(),
result: null result: null
}; };
if ( response.shutdown === false ) { if ( !response.shutdown ) {
response.result = filterRequests(pageStore, details); response.result = filterRequests(pageStore, details);
} }
break; break;