Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 12 matching lines...) Expand all Loading... | |
23 Cu.import("resource://gre/modules/Services.jsm"); | 23 Cu.import("resource://gre/modules/Services.jsm"); |
24 | 24 |
25 let {FilterStorage} = require("filterStorage"); | 25 let {FilterStorage} = require("filterStorage"); |
26 let {FilterNotifier} = require("filterNotifier"); | 26 let {FilterNotifier} = require("filterNotifier"); |
27 let {ElemHide} = require("elemHide"); | 27 let {ElemHide} = require("elemHide"); |
28 let {CSSRules} = require("cssRules"); | 28 let {CSSRules} = require("cssRules"); |
29 let {defaultMatcher} = require("matcher"); | 29 let {defaultMatcher} = require("matcher"); |
30 let {ActiveFilter, RegExpFilter, ElemHideBase, CSSPropertyFilter} = | 30 let {ActiveFilter, RegExpFilter, ElemHideBase, CSSPropertyFilter} = |
31 require("filterClasses"); | 31 require("filterClasses"); |
32 let {Prefs} = require("prefs"); | 32 let {Prefs} = require("prefs"); |
33 let {FilterHits} = require("filterHits"); | |
Wladimir Palant
2016/02/29 14:40:30
This needs to be included conditionally - this fil
saroyanm
2016/03/18 18:24:47
Done.
| |
33 | 34 |
34 /** | 35 /** |
35 * Value of the FilterListener.batchMode property. | 36 * Value of the FilterListener.batchMode property. |
36 * @type Boolean | 37 * @type Boolean |
37 */ | 38 */ |
38 let batchMode = false; | 39 let batchMode = false; |
39 | 40 |
40 /** | 41 /** |
41 * Increases on filter changes, filters will be saved if it exceeds 1. | 42 * Increases on filter changes, filters will be saved if it exceeds 1. |
42 * @type Integer | 43 * @type Integer |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 * Observer listening to history purge actions. | 88 * Observer listening to history purge actions. |
88 * @class | 89 * @class |
89 */ | 90 */ |
90 let HistoryPurgeObserver = | 91 let HistoryPurgeObserver = |
91 { | 92 { |
92 observe: function(subject, topic, data) | 93 observe: function(subject, topic, data) |
93 { | 94 { |
94 if (topic == "browser:purge-session-history" && Prefs.clearStatsOnHistoryPur ge) | 95 if (topic == "browser:purge-session-history" && Prefs.clearStatsOnHistoryPur ge) |
95 { | 96 { |
96 FilterStorage.resetHitCounts(); | 97 FilterStorage.resetHitCounts(); |
98 FilterHits.resetFilterHits(); | |
97 FilterListener.setDirty(0); // Force saving to disk | 99 FilterListener.setDirty(0); // Force saving to disk |
98 | 100 |
99 Prefs.recentReports = []; | 101 Prefs.recentReports = []; |
100 } | 102 } |
101 }, | 103 }, |
102 QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference, Ci.nsIObse rver]) | 104 QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference, Ci.nsIObse rver]) |
103 }; | 105 }; |
104 | 106 |
105 /** | 107 /** |
106 * Initializes filter listener on startup, registers the necessary hooks. | 108 * Initializes filter listener on startup, registers the necessary hooks. |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 ElemHide.clear(); | 283 ElemHide.clear(); |
282 CSSRules.clear(); | 284 CSSRules.clear(); |
283 for (let subscription of FilterStorage.subscriptions) | 285 for (let subscription of FilterStorage.subscriptions) |
284 if (!subscription.disabled) | 286 if (!subscription.disabled) |
285 subscription.filters.forEach(addFilter); | 287 subscription.filters.forEach(addFilter); |
286 flushElemHide(); | 288 flushElemHide(); |
287 } | 289 } |
288 else if (action == "save") | 290 else if (action == "save") |
289 isDirty = 0; | 291 isDirty = 0; |
290 } | 292 } |
OLD | NEW |