mirror of https://github.com/gorhill/uBlock.git
code review
This commit is contained in:
parent
28fc4f99d4
commit
475aa5a8fc
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue