| LEFT | RIGHT |
| 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-2017 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 subscriptions_exceptionsurl_privacy: "https://easylist-downloads.adblockplus
.org/exceptionrules-privacy.txt" |
| 107 }; | 107 }; |
| 108 for (let key of Object.keys(prefs)) | 108 for (let key of Object.keys(prefs)) |
| 109 { | 109 { |
| 110 Object.defineProperty(modules.prefs.Prefs, key, { | 110 Object.defineProperty(modules.prefs.Prefs, key, { |
| 111 get() | 111 get() |
| 112 { | 112 { |
| 113 return prefs[key]; | 113 return prefs[key]; |
| 114 }, | 114 }, |
| 115 set(value) | 115 set(value) |
| 116 { | 116 { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 135 } | 135 } |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 function Subscription(url) | 138 function Subscription(url) |
| 139 { | 139 { |
| 140 this.url = url; | 140 this.url = url; |
| 141 this._disabled = false; | 141 this._disabled = false; |
| 142 this._lastDownload = 1234; | 142 this._lastDownload = 1234; |
| 143 this.homepage = "https://easylist.adblockplus.org/"; | 143 this.homepage = "https://easylist.adblockplus.org/"; |
| 144 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 } |
| 145 } | 154 } |
| 146 Subscription.prototype = | 155 Subscription.prototype = |
| 147 { | 156 { |
| 148 get disabled() | 157 get disabled() |
| 149 { | 158 { |
| 150 return this._disabled; | 159 return this._disabled; |
| 151 }, | 160 }, |
| 152 set disabled(value) | 161 set disabled(value) |
| 153 { | 162 { |
| 154 this._disabled = value; | 163 this._disabled = value; |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 "###Werbung_Sky", | 441 "###Werbung_Sky", |
| 433 "###Werbung_Wide", | 442 "###Werbung_Wide", |
| 434 "###__ligatus_placeholder__", | 443 "###__ligatus_placeholder__", |
| 435 "###ad-bereich1-08", | 444 "###ad-bereich1-08", |
| 436 "###ad-bereich1-superbanner", | 445 "###ad-bereich1-superbanner", |
| 437 "###ad-bereich2-08", | 446 "###ad-bereich2-08", |
| 438 "###ad-bereich2-skyscrapper" | 447 "###ad-bereich2-skyscrapper" |
| 439 ]; | 448 ]; |
| 440 let knownFilters = filters.map(modules.filterClasses.Filter.fromText); | 449 let knownFilters = filters.map(modules.filterClasses.Filter.fromText); |
| 441 | 450 |
| 442 let subscriptions = [ | 451 let subscriptions = { |
| 443 "https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt", | 452 "https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt": { |
| 444 "https://easylist-downloads.adblockplus.org/exceptionrules.txt", | 453 title: "EasyList Germany+EasyList" |
| 445 "https://easylist-downloads.adblockplus.org/fanboy-social.txt", | 454 }, |
| 446 "https://easylist-downloads.adblockplus.org/antiadblockfilters.txt", | 455 "https://easylist-downloads.adblockplus.org/exceptionrules.txt": { |
| 447 "~user~786254" | 456 title: "Allow non-intrusive advertising" |
| 448 ]; | 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 |
| 449 let knownSubscriptions = Object.create(null); | 470 let knownSubscriptions = Object.create(null); |
| 450 for (let subscriptionUrl of subscriptions) | 471 for (let subscriptionUrl in subscriptions) |
| 451 { | 472 { |
| 452 knownSubscriptions[subscriptionUrl] = | 473 knownSubscriptions[subscriptionUrl] = |
| 453 modules.subscriptionClasses.Subscription.fromURL(subscriptionUrl); | 474 modules.subscriptionClasses.Subscription.fromURL(subscriptionUrl); |
| 454 } | 475 } |
| 455 let customSubscription = knownSubscriptions["~user~786254"]; | 476 let customSubscription = knownSubscriptions["~user~786254"]; |
| 456 | 477 |
| 457 if (params.addSubscription) | 478 if (params.addSubscription) |
| 458 { | 479 { |
| 459 // 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 |
| 460 // 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... |
| 542 }, | 563 }, |
| 543 filter: { | 564 filter: { |
| 544 text: "||example.com/some-annoying-popup$popup", | 565 text: "||example.com/some-annoying-popup$popup", |
| 545 whitelisted: false, | 566 whitelisted: false, |
| 546 userDefined: true, | 567 userDefined: true, |
| 547 subscription: null | 568 subscription: null |
| 548 } | 569 } |
| 549 }); | 570 }); |
| 550 }); | 571 }); |
| 551 }()); | 572 }()); |
| LEFT | RIGHT |