Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: background.js

Issue 29478597: Issue 5326 - General tab (HTML, strings and functionality) (Closed)
Left Patch Set: Created Aug. 16, 2017, 2:12 p.m.
Right Patch Set: rebase Created Aug. 23, 2017, 12:36 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | locale/en-US/new-options.json » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 145
146 if (this.url == prefs.subscriptions_exceptionsurl) 146 if (subscriptions[this.url] && subscriptions[this.url].title)
147 { 147 {
148 this.title = "Allow non-intrusive advertising"; 148 this.title = subscriptions[this.url].title;
149 } 149 }
150 else if (this.url == prefs.subscriptions_exceptionsurl_privacy) 150 if (this.url == prefs.subscriptions_exceptionsurl_privacy)
151 { 151 {
152 this.title = "Allow only nonintrusive ads that are privacy-friendly"; 152 this.title = "Allow only nonintrusive ads that are privacy-friendly";
153 } 153 }
154 } 154 }
155 Subscription.prototype = 155 Subscription.prototype =
156 { 156 {
157 get disabled() 157 get disabled()
158 { 158 {
159 return this._disabled; 159 return this._disabled;
160 }, 160 },
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 "###Werbung_Sky", 441 "###Werbung_Sky",
442 "###Werbung_Wide", 442 "###Werbung_Wide",
443 "###__ligatus_placeholder__", 443 "###__ligatus_placeholder__",
444 "###ad-bereich1-08", 444 "###ad-bereich1-08",
445 "###ad-bereich1-superbanner", 445 "###ad-bereich1-superbanner",
446 "###ad-bereich2-08", 446 "###ad-bereich2-08",
447 "###ad-bereich2-skyscrapper" 447 "###ad-bereich2-skyscrapper"
448 ]; 448 ];
449 let knownFilters = filters.map(modules.filterClasses.Filter.fromText); 449 let knownFilters = filters.map(modules.filterClasses.Filter.fromText);
450 450
451 let subscriptions = [ 451 let subscriptions = {
452 "https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt", 452 "https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt": {
453 "https://easylist-downloads.adblockplus.org/exceptionrules.txt", 453 title: "EasyList Germany+EasyList"
454 "https://easylist-downloads.adblockplus.org/fanboy-social.txt", 454 },
455 "https://easylist-downloads.adblockplus.org/antiadblockfilters.txt", 455 "https://easylist-downloads.adblockplus.org/exceptionrules.txt": {
456 "~user~786254" 456 title: "Allow non-intrusive advertising"
457 ]; 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
458 let knownSubscriptions = Object.create(null); 470 let knownSubscriptions = Object.create(null);
459 for (let subscriptionUrl of subscriptions) 471 for (let subscriptionUrl in subscriptions)
460 { 472 {
461 knownSubscriptions[subscriptionUrl] = 473 knownSubscriptions[subscriptionUrl] =
462 modules.subscriptionClasses.Subscription.fromURL(subscriptionUrl); 474 modules.subscriptionClasses.Subscription.fromURL(subscriptionUrl);
463 } 475 }
464 let customSubscription = knownSubscriptions["~user~786254"]; 476 let customSubscription = knownSubscriptions["~user~786254"];
465 477
466 if (params.addSubscription) 478 if (params.addSubscription)
467 { 479 {
468 // 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
469 // 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
551 }, 563 },
552 filter: { 564 filter: {
553 text: "||example.com/some-annoying-popup$popup", 565 text: "||example.com/some-annoying-popup$popup",
554 whitelisted: false, 566 whitelisted: false,
555 userDefined: true, 567 userDefined: true,
556 subscription: null 568 subscription: null
557 } 569 }
558 }); 570 });
559 }); 571 });
560 }()); 572 }());
LEFTRIGHT

Powered by Google App Engine
This is Rietveld