Index: lib/filterListener.js |
=================================================================== |
--- a/lib/filterListener.js |
+++ b/lib/filterListener.js |
@@ -24,20 +24,21 @@ |
const {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); |
const {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {}); |
const {FilterStorage} = require("./filterStorage"); |
const {FilterNotifier} = require("./filterNotifier"); |
const {ElemHide} = require("./elemHide"); |
const {ElemHideEmulation} = require("./elemHideEmulation"); |
+const {ElemHideExceptions} = require("./elemHideExceptions"); |
const {Snippets} = require("./snippets"); |
const {defaultMatcher} = require("./matcher"); |
const {ActiveFilter, RegExpFilter, |
- ElemHideBase, ElemHideEmulationFilter, |
+ ElemHideBase, ElemHideFilter, ElemHideEmulationFilter, |
SnippetFilter} = require("./filterClasses"); |
const {SpecialSubscription} = require("./subscriptionClasses"); |
const {Prefs} = require("prefs"); |
/** |
* Increases on filter changes, filters will be saved if it exceeds 1. |
* @type {number} |
*/ |
@@ -162,20 +163,22 @@ |
} |
if (!hasEnabled) |
return; |
if (filter instanceof RegExpFilter) |
defaultMatcher.add(filter); |
else if (filter instanceof ElemHideBase) |
{ |
- if (filter instanceof ElemHideEmulationFilter) |
+ if (filter instanceof ElemHideFilter) |
+ ElemHide.add(filter); |
+ else if (filter instanceof ElemHideEmulationFilter) |
ElemHideEmulation.add(filter); |
else |
- ElemHide.add(filter); |
+ ElemHideExceptions.add(filter); |
} |
else if (allowSnippets && filter instanceof SnippetFilter) |
Snippets.add(filter); |
} |
/** |
* Notifies Matcher instances or ElemHide object about removal of a filter |
* if necessary. |
@@ -200,20 +203,22 @@ |
if (hasEnabled) |
return; |
} |
if (filter instanceof RegExpFilter) |
defaultMatcher.remove(filter); |
else if (filter instanceof ElemHideBase) |
{ |
- if (filter instanceof ElemHideEmulationFilter) |
+ if (filter instanceof ElemHideFilter) |
+ ElemHide.remove(filter); |
+ else if (filter instanceof ElemHideEmulationFilter) |
ElemHideEmulation.remove(filter); |
else |
- ElemHide.remove(filter); |
+ ElemHideExceptions.remove(filter); |
} |
else if (filter instanceof SnippetFilter) |
Snippets.remove(filter); |
} |
const primes = [101, 109, 131, 149, 163, 179, 193, 211, 229, 241]; |
function addFilters(filters) |
@@ -326,16 +331,17 @@ |
function onLoad() |
{ |
isDirty = 0; |
defaultMatcher.clear(); |
ElemHide.clear(); |
ElemHideEmulation.clear(); |
+ ElemHideExceptions.clear(); |
Snippets.clear(); |
for (let subscription of FilterStorage.subscriptions) |
{ |
if (!subscription.disabled) |
addFilters(subscription.filters); |
} |
} |