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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 } | 96 } |
97 }; | 97 }; |
98 | 98 |
99 modules.prefs = {Prefs: new EventEmitter()}; | 99 modules.prefs = {Prefs: new EventEmitter()}; |
100 let prefs = { | 100 let prefs = { |
101 notifications_ignoredcategories: (params.showNotificationUI) ? ["*"] : [], | 101 notifications_ignoredcategories: (params.showNotificationUI) ? ["*"] : [], |
102 notifications_showui: params.showNotificationUI, | 102 notifications_showui: params.showNotificationUI, |
103 shouldShowBlockElementMenu: true, | 103 shouldShowBlockElementMenu: true, |
104 show_devtools_panel: true, | 104 show_devtools_panel: true, |
105 subscriptions_exceptionsurl: "https://easylist-downloads.adblockplus.org/exc
eptionrules.txt" | 105 subscriptions_exceptionsurl: "https://easylist-downloads.adblockplus.org/exc
eptionrules.txt", |
| 106 subscriptions_exceptionsurl_privacy: "https://easylist-downloads.adblockplus
.org/exceptionrules-privacy.txt" |
106 }; | 107 }; |
107 for (let key of Object.keys(prefs)) | 108 for (let key of Object.keys(prefs)) |
108 { | 109 { |
109 Object.defineProperty(modules.prefs.Prefs, key, { | 110 Object.defineProperty(modules.prefs.Prefs, key, { |
110 get() | 111 get() |
111 { | 112 { |
112 return prefs[key]; | 113 return prefs[key]; |
113 }, | 114 }, |
114 set(value) | 115 set(value) |
115 { | 116 { |
(...skipping 18 matching lines...) Expand all Loading... |
134 } | 135 } |
135 }; | 136 }; |
136 | 137 |
137 function Subscription(url) | 138 function Subscription(url) |
138 { | 139 { |
139 this.url = url; | 140 this.url = url; |
140 this._disabled = false; | 141 this._disabled = false; |
141 this._lastDownload = 1234; | 142 this._lastDownload = 1234; |
142 this.homepage = "https://easylist.adblockplus.org/"; | 143 this.homepage = "https://easylist.adblockplus.org/"; |
143 this.downloadStatus = params.downloadStatus; | 144 this.downloadStatus = params.downloadStatus; |
| 145 |
| 146 if (subscriptions[this.url] && subscriptions[this.url].title) |
| 147 { |
| 148 this.title = subscriptions[this.url].title; |
| 149 } |
| 150 if (this.url == prefs.subscriptions_exceptionsurl_privacy) |
| 151 { |
| 152 this.title = "Allow only nonintrusive ads that are privacy-friendly"; |
| 153 } |
144 } | 154 } |
145 Subscription.prototype = | 155 Subscription.prototype = |
146 { | 156 { |
147 get disabled() | 157 get disabled() |
148 { | 158 { |
149 return this._disabled; | 159 return this._disabled; |
150 }, | 160 }, |
151 set disabled(value) | 161 set disabled(value) |
152 { | 162 { |
153 this._disabled = value; | 163 this._disabled = value; |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 "###Werbung_Sky", | 441 "###Werbung_Sky", |
432 "###Werbung_Wide", | 442 "###Werbung_Wide", |
433 "###__ligatus_placeholder__", | 443 "###__ligatus_placeholder__", |
434 "###ad-bereich1-08", | 444 "###ad-bereich1-08", |
435 "###ad-bereich1-superbanner", | 445 "###ad-bereich1-superbanner", |
436 "###ad-bereich2-08", | 446 "###ad-bereich2-08", |
437 "###ad-bereich2-skyscrapper" | 447 "###ad-bereich2-skyscrapper" |
438 ]; | 448 ]; |
439 let knownFilters = filters.map(modules.filterClasses.Filter.fromText); | 449 let knownFilters = filters.map(modules.filterClasses.Filter.fromText); |
440 | 450 |
441 let subscriptions = [ | 451 let subscriptions = { |
442 "https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt", | 452 "https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt": { |
443 "https://easylist-downloads.adblockplus.org/exceptionrules.txt", | 453 title: "EasyList Germany+EasyList" |
444 "https://easylist-downloads.adblockplus.org/fanboy-social.txt", | 454 }, |
445 "~user~786254" | 455 "https://easylist-downloads.adblockplus.org/exceptionrules.txt": { |
446 ]; | 456 title: "Allow non-intrusive advertising" |
| 457 }, |
| 458 "https://easylist-downloads.adblockplus.org/fanboy-social.txt": { |
| 459 title: "Fanboy's Social Blocking List", |
| 460 type: "social" |
| 461 }, |
| 462 "https://easylist-downloads.adblockplus.org/antiadblockfilters.txt": { |
| 463 title: "Adblock Warning Removal List" |
| 464 }, |
| 465 "~user~78625": { |
| 466 title: "My filter list" |
| 467 } |
| 468 }; |
| 469 |
447 let knownSubscriptions = Object.create(null); | 470 let knownSubscriptions = Object.create(null); |
448 for (let subscriptionUrl of subscriptions) | 471 for (let subscriptionUrl in subscriptions) |
449 { | 472 { |
450 knownSubscriptions[subscriptionUrl] = | 473 knownSubscriptions[subscriptionUrl] = |
451 modules.subscriptionClasses.Subscription.fromURL(subscriptionUrl); | 474 modules.subscriptionClasses.Subscription.fromURL(subscriptionUrl); |
452 } | 475 } |
453 let customSubscription = knownSubscriptions["~user~786254"]; | 476 let customSubscription = knownSubscriptions["~user~786254"]; |
454 | 477 |
455 if (params.addSubscription) | 478 if (params.addSubscription) |
456 { | 479 { |
457 // We don't know how long it will take for the page to fully load | 480 // We don't know how long it will take for the page to fully load |
458 // so we'll post the message after one second | 481 // so we'll post the message after one second |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 }, | 563 }, |
541 filter: { | 564 filter: { |
542 text: "||example.com/some-annoying-popup$popup", | 565 text: "||example.com/some-annoying-popup$popup", |
543 whitelisted: false, | 566 whitelisted: false, |
544 userDefined: true, | 567 userDefined: true, |
545 subscription: null | 568 subscription: null |
546 } | 569 } |
547 }); | 570 }); |
548 }); | 571 }); |
549 }()); | 572 }()); |
OLD | NEW |