mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-03 17:49:39 +02:00
cosmetic filtering switch must disable ONLY cosmetic filtering.
Before this fix, the turning off cosmetic filtering through the per-site cosmetic filtering switch was also disabling the blocked resources collapser.
This commit is contained in:
parent
47f6a565fa
commit
9c12ef02bb
@ -134,9 +134,11 @@ var netFilters = function(details) {
|
||||
var filteringHandler = function(details) {
|
||||
var styleTagCount = vAPI.styles.length;
|
||||
|
||||
vAPI.skipCosmeticFiltering = !details || details.skipCosmeticFiltering;
|
||||
if ( details ) {
|
||||
if ( details.cosmeticHide.length !== 0 || details.cosmeticDonthide.length !== 0 ) {
|
||||
if (
|
||||
(vAPI.skipCosmeticFiltering = details.skipCosmeticFiltering) !== true &&
|
||||
(details.cosmeticHide.length !== 0 || details.cosmeticDonthide.length !== 0)
|
||||
) {
|
||||
cosmeticFilters(details);
|
||||
}
|
||||
if ( details.netHide.length !== 0 ) {
|
||||
|
@ -295,7 +295,8 @@ var popupDataFromTabId = function(tabId, tabTitle) {
|
||||
pageAllowedRequestCount: 0,
|
||||
pageBlockedRequestCount: 0,
|
||||
tabId: tabId,
|
||||
tabTitle: tabTitle
|
||||
tabTitle: tabTitle,
|
||||
tooltipsDisabled: µb.userSettings.tooltipsDisabled
|
||||
};
|
||||
|
||||
var pageStore = µb.pageStoreFromTabId(tabId);
|
||||
@ -469,8 +470,11 @@ var onMessage = function(request, sender, callback) {
|
||||
|
||||
switch ( request.what ) {
|
||||
case 'retrieveDomainCosmeticSelectors':
|
||||
if ( pageStore && pageStore.getSpecificCosmeticFilteringSwitch() ) {
|
||||
if ( pageStore && pageStore.getNetFilteringSwitch() ) {
|
||||
response = µb.cosmeticFilteringEngine.retrieveDomainSelectors(request);
|
||||
if ( response && response.skipCosmeticFiltering !== true ) {
|
||||
response.skipCosmeticFiltering = !pageStore.getSpecificCosmeticFilteringSwitch();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -447,10 +447,6 @@ PageStore.prototype.getNetFilteringSwitch = function() {
|
||||
/******************************************************************************/
|
||||
|
||||
PageStore.prototype.getSpecificCosmeticFilteringSwitch = function() {
|
||||
if ( this.getNetFilteringSwitch() === false ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var tabContext = µb.tabContextManager.mustLookup(this.tabId);
|
||||
|
||||
if ( µb.hnSwitches.evaluateZ('no-cosmetic-filtering', tabContext.rootHostname) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user