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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 filterNotifier.on("filter.lastHit", onFilterLastHit); | 101 filterNotifier.on("filter.lastHit", onFilterLastHit); |
102 filterNotifier.on("filter.added", onFilterAdded); | 102 filterNotifier.on("filter.added", onFilterAdded); |
103 filterNotifier.on("filter.removed", onFilterRemoved); | 103 filterNotifier.on("filter.removed", onFilterRemoved); |
104 filterNotifier.on("filter.disabled", onFilterDisabled); | 104 filterNotifier.on("filter.disabled", onFilterDisabled); |
105 filterNotifier.on("filter.moved", onGenericChange); | 105 filterNotifier.on("filter.moved", onGenericChange); |
106 | 106 |
107 filterNotifier.on("subscription.added", onSubscriptionAdded); | 107 filterNotifier.on("subscription.added", onSubscriptionAdded); |
108 filterNotifier.on("subscription.removed", onSubscriptionRemoved); | 108 filterNotifier.on("subscription.removed", onSubscriptionRemoved); |
109 filterNotifier.on("subscription.disabled", onSubscriptionDisabled); | 109 filterNotifier.on("subscription.disabled", onSubscriptionDisabled); |
110 filterNotifier.on("subscription.updated", onSubscriptionUpdated); | 110 filterNotifier.on("subscription.updated", onSubscriptionUpdated); |
111 filterNotifier.on("subscription.moved", onGenericChange); | |
112 filterNotifier.on("subscription.title", onGenericChange); | 111 filterNotifier.on("subscription.title", onGenericChange); |
113 filterNotifier.on("subscription.fixedTitle", onGenericChange); | 112 filterNotifier.on("subscription.fixedTitle", onGenericChange); |
114 filterNotifier.on("subscription.homepage", onGenericChange); | 113 filterNotifier.on("subscription.homepage", onGenericChange); |
115 filterNotifier.on("subscription.downloadStatus", onGenericChange); | 114 filterNotifier.on("subscription.downloadStatus", onGenericChange); |
116 filterNotifier.on("subscription.lastCheck", onGenericChange); | 115 filterNotifier.on("subscription.lastCheck", onGenericChange); |
117 filterNotifier.on("subscription.errors", onGenericChange); | 116 filterNotifier.on("subscription.errors", onGenericChange); |
118 | 117 |
119 filterNotifier.on("load", onLoad); | 118 filterNotifier.on("load", onLoad); |
120 filterNotifier.on("save", onSave); | 119 filterNotifier.on("save", onSave); |
121 | 120 |
(...skipping 23 matching lines...) Expand all Loading... |
145 let allowSnippets = false; | 144 let allowSnippets = false; |
146 for (let subscription of filter.subscriptions()) | 145 for (let subscription of filter.subscriptions()) |
147 { | 146 { |
148 if (!subscription.disabled) | 147 if (!subscription.disabled) |
149 { | 148 { |
150 hasEnabled = true; | 149 hasEnabled = true; |
151 | 150 |
152 // Allow snippets to be executed only by the circumvention lists or the | 151 // Allow snippets to be executed only by the circumvention lists or the |
153 // user's own filters. | 152 // user's own filters. |
154 if (subscription.type == "circumvention" || | 153 if (subscription.type == "circumvention" || |
155 subscription.url == "https://easylist-downloads.adblockplus.org/abp-fi
lters-anti-cv.txt" || | 154 subscription.url == "https://easylist-downloads.adblockplus.org/abp-fi
lters-anti-cv.txt" || |
156 subscription instanceof SpecialSubscription) | 155 subscription instanceof SpecialSubscription) |
157 { | 156 { |
158 allowSnippets = true; | 157 allowSnippets = true; |
159 break; | 158 break; |
160 } | 159 } |
161 } | 160 } |
162 } | 161 } |
163 if (!hasEnabled) | 162 if (!hasEnabled) |
164 return; | 163 return; |
165 | 164 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 329 |
331 function onLoad() | 330 function onLoad() |
332 { | 331 { |
333 isDirty = 0; | 332 isDirty = 0; |
334 | 333 |
335 defaultMatcher.clear(); | 334 defaultMatcher.clear(); |
336 ElemHide.clear(); | 335 ElemHide.clear(); |
337 ElemHideEmulation.clear(); | 336 ElemHideEmulation.clear(); |
338 ElemHideExceptions.clear(); | 337 ElemHideExceptions.clear(); |
339 Snippets.clear(); | 338 Snippets.clear(); |
340 for (let subscription of FilterStorage.subscriptions) | 339 for (let subscription of FilterStorage.subscriptions()) |
341 { | 340 { |
342 if (!subscription.disabled) | 341 if (!subscription.disabled) |
343 addFilters(subscription.filters); | 342 addFilters(subscription.filters); |
344 } | 343 } |
345 } | 344 } |
346 | 345 |
347 function onSave() | 346 function onSave() |
348 { | 347 { |
349 isDirty = 0; | 348 isDirty = 0; |
350 } | 349 } |
OLD | NEW |