Completes fix for #1208

This commit is contained in:
Chris 2015-04-07 22:22:12 -06:00
parent 6de836b21f
commit ff3a3b14b1
1 changed files with 9 additions and 2 deletions

View File

@ -485,14 +485,19 @@ var onMessage = function(details, sender, callback) {
// Sync // Sync
var response; var response;
var pageStore; var pageStore, frameStore = false;
if ( sender && sender.tab ) { if ( sender && sender.tab ) {
pageStore = µb.pageStoreFromTabId(sender.tab.id); pageStore = µb.pageStoreFromTabId(sender.tab.id);
var frameId = sender.frameId;
if(frameId && frameId > 0) {
frameStore = pageStore.getFrame(frameId);
}
} }
switch ( details.what ) { switch ( details.what ) {
case 'retrieveGenericCosmeticSelectors': case 'retrieveGenericCosmeticSelectors':
if ( pageStore && pageStore.getGenericCosmeticFilteringSwitch() ) { if ( pageStore && pageStore.getGenericCosmeticFilteringSwitch()
&& (!frameStore || frameStore.getNetFilteringSwitch()) ) {
response = µb.cosmeticFilteringEngine.retrieveGenericSelectors(details); response = µb.cosmeticFilteringEngine.retrieveGenericSelectors(details);
} }
break; break;
@ -841,6 +846,8 @@ var onMessage = function(request, sender, callback) {
case 'setWhitelist': case 'setWhitelist':
µb.netWhitelist = µb.whitelistFromString(request.whitelist); µb.netWhitelist = µb.whitelistFromString(request.whitelist);
µb.saveWhitelist(); µb.saveWhitelist();
// #1208
µb.cosmeticFilteringEngine.removeFromSelectorCache('*');
break; break;
default: default: