mirror of https://github.com/gorhill/uBlock.git
Completes fix for #1208
This commit is contained in:
parent
6de836b21f
commit
ff3a3b14b1
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue