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

Side by Side Diff: lib/subscriptionInit.js

Issue 29338315: Issue 3801 - Add pre-configurable preference for additional subscriptions (Closed)
Patch Set: Created March 15, 2016, 1:40 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/prefs.js ('k') | options.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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
95 95
96 /** 96 /**
97 * Gets the filter subscriptions to be added when the extnesion is loaded. 97 * Gets the filter subscriptions to be added when the extnesion is loaded.
98 * 98 *
99 * @return {Promise|Subscription[]} 99 * @return {Promise|Subscription[]}
100 */ 100 */
101 function getSubscriptions() 101 function getSubscriptions()
102 { 102 {
103 let subscriptions = []; 103 let subscriptions = [];
104 104
105 // Add pre-configured subscriptions
106 for (let url of Prefs.additional_subscriptions)
107 subscriptions.push(Subscription.fromURL(url));
108
105 // Add "acceptable ads" and "anti-adblock messages" subscriptions 109 // Add "acceptable ads" and "anti-adblock messages" subscriptions
106 if (firstRun) 110 if (firstRun)
107 { 111 {
108 let acceptableAdsSubscription = Subscription.fromURL( 112 let acceptableAdsSubscription = Subscription.fromURL(
109 Prefs.subscriptions_exceptionsurl 113 Prefs.subscriptions_exceptionsurl
110 ); 114 );
111 acceptableAdsSubscription.title = "Allow non-intrusive advertising"; 115 acceptableAdsSubscription.title = "Allow non-intrusive advertising";
112 subscriptions.push(acceptableAdsSubscription); 116 subscriptions.push(acceptableAdsSubscription);
113 117
114 let antiAdblockSubscription = Subscription.fromURL( 118 let antiAdblockSubscription = Subscription.fromURL(
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 * Sets a callback that is called with an array of subscriptions to be added 189 * Sets a callback that is called with an array of subscriptions to be added
186 * during initialization. The callback must return an array of subscriptions 190 * during initialization. The callback must return an array of subscriptions
187 * that will effectively be added. 191 * that will effectively be added.
188 * 192 *
189 * @param {function} 193 * @param {function}
190 */ 194 */
191 exports.setSubscriptionsCallback = function(callback) 195 exports.setSubscriptionsCallback = function(callback)
192 { 196 {
193 subscriptionsCallback = callback; 197 subscriptionsCallback = callback;
194 }; 198 };
OLDNEW
« no previous file with comments | « lib/prefs.js ('k') | options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld