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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 }, | 156 }, |
157 shouldDisplay() | 157 shouldDisplay() |
158 { | 158 { |
159 return true; | 159 return true; |
160 } | 160 } |
161 }; | 161 }; |
162 | 162 |
163 let subscriptionDetails = { | 163 let subscriptionDetails = { |
164 [easyListGermany]: { | 164 [easyListGermany]: { |
165 title: "EasyList Germany+EasyList", | 165 title: "EasyList Germany+EasyList", |
| 166 filters: ["-ad-banner.", "-ad-big.", "-ad-bottom-", "-ad-button-"], |
166 installed: true | 167 installed: true |
167 }, | 168 }, |
168 [acceptableAds]: { | 169 [acceptableAds]: { |
169 title: "Allow non-intrusive advertising", | 170 title: "Allow non-intrusive advertising", |
170 installed: true | 171 installed: true |
171 }, | 172 }, |
172 [acceptableAdsPrivacyFriendly]: { | 173 [acceptableAdsPrivacyFriendly]: { |
173 title: "Allow only nonintrusive ads that are privacy-friendly" | 174 title: "Allow only nonintrusive ads that are privacy-friendly" |
174 }, | 175 }, |
175 [`${subscriptionServer}/fanboy-social.txt`]: { | 176 [`${subscriptionServer}/fanboy-social.txt`]: { |
176 title: "Fanboy's Social Blocking List", | 177 title: "Fanboy's Social Blocking List", |
177 installed: true | 178 installed: true |
178 }, | 179 }, |
179 [`${subscriptionServer}/antiadblockfilters.txt`]: { | 180 [`${subscriptionServer}/antiadblockfilters.txt`]: { |
180 title: "Adblock Warning Removal List", | 181 title: "Adblock Warning Removal List", |
181 installed: true, | 182 installed: true, |
182 disabled: true | 183 disabled: true |
183 }, | 184 }, |
184 "~user~786254": { | 185 "~user~786254": { |
185 installed: true | 186 installed: true |
186 } | 187 } |
187 }; | 188 }; |
188 | 189 |
189 function Subscription(url) | 190 function Subscription(url) |
190 { | 191 { |
191 this.url = url; | 192 this.url = url; |
192 this._disabled = false; | 193 this._disabled = false; |
193 this._lastDownload = 1234; | 194 this._lastDownload = 1234; |
| 195 this.filters = []; |
194 this.homepage = "https://easylist.adblockplus.org/"; | 196 this.homepage = "https://easylist.adblockplus.org/"; |
195 this.downloadStatus = params.downloadStatus; | 197 this.downloadStatus = params.downloadStatus; |
196 | 198 |
197 let details = subscriptionDetails[this.url]; | 199 let details = subscriptionDetails[this.url]; |
198 if (details) | 200 if (details) |
199 { | 201 { |
200 this.disabled = !!details.disabled; | 202 this.disabled = !!details.disabled; |
201 this.title = details.title || ""; | 203 this.title = details.title || ""; |
| 204 this.filters = this.filters.concat(details.filters); |
202 } | 205 } |
203 } | 206 } |
204 Subscription.prototype = | 207 Subscription.prototype = |
205 { | 208 { |
206 get disabled() | 209 get disabled() |
207 { | 210 { |
208 return this._disabled; | 211 return this._disabled; |
209 }, | 212 }, |
210 set disabled(value) | 213 set disabled(value) |
211 { | 214 { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 } | 320 } |
318 }; | 321 }; |
319 | 322 |
320 function Filter(text) | 323 function Filter(text) |
321 { | 324 { |
322 this.text = text; | 325 this.text = text; |
323 this.disabled = false; | 326 this.disabled = false; |
324 } | 327 } |
325 Filter.fromText = (text) => new Filter(text); | 328 Filter.fromText = (text) => new Filter(text); |
326 | 329 |
| 330 function ActiveFilter() |
| 331 { |
| 332 } |
| 333 |
327 function BlockingFilter() | 334 function BlockingFilter() |
328 { | 335 { |
329 } | 336 } |
330 | 337 |
331 function RegExpFilter() | 338 function RegExpFilter() |
332 { | 339 { |
333 } | 340 } |
334 RegExpFilter.typeMap = Object.create(null); | 341 RegExpFilter.typeMap = Object.create(null); |
335 | 342 |
336 modules.filterClasses = { | 343 modules.filterClasses = { |
| 344 ActiveFilter, |
337 BlockingFilter, | 345 BlockingFilter, |
338 Filter, | 346 Filter, |
339 RegExpFilter | 347 RegExpFilter |
340 }; | 348 }; |
341 | 349 |
342 modules.filterValidation = | 350 modules.filterValidation = |
343 { | 351 { |
344 parseFilter(text) | 352 parseFilter(text) |
345 { | 353 { |
346 if (params.filterError) | 354 if (params.filterError) |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 }, | 628 }, |
621 filter: { | 629 filter: { |
622 text: "||example.com/some-annoying-popup$popup", | 630 text: "||example.com/some-annoying-popup$popup", |
623 whitelisted: false, | 631 whitelisted: false, |
624 userDefined: true, | 632 userDefined: true, |
625 subscription: null | 633 subscription: null |
626 } | 634 } |
627 }); | 635 }); |
628 }); | 636 }); |
629 }()); | 637 }()); |
OLD | NEW |