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

Delta Between Two Patch Sets: lib/prefs.js

Issue 29363607: Issue 4612 - enable AA on first run and make automatic adding of any subscription optional (Closed)
Left Patch Set: Created Nov. 21, 2016, 10:21 a.m.
Right Patch Set: reduce number of attempts to remove test files Created Dec. 2, 2016, 2:15 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 | « lib/init.js ('k') | test/FilterEngine.cpp » ('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-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 14 matching lines...) Expand all
25 patternsfile: "patterns.ini", 25 patternsfile: "patterns.ini",
26 patternsbackups: 5, 26 patternsbackups: 5,
27 patternsbackupinterval: 24, 27 patternsbackupinterval: 24,
28 data_directory: "", 28 data_directory: "",
29 savestats: false, 29 savestats: false,
30 privateBrowsing: false, 30 privateBrowsing: false,
31 subscriptions_fallbackerrors: 5, 31 subscriptions_fallbackerrors: 5,
32 subscriptions_fallbackurl: "https://adblockplus.org/getSubscription?version=%V ERSION%&url=%SUBSCRIPTION%&downloadURL=%URL%&error=%ERROR%&channelStatus=%CHANNE LSTATUS%&responseStatus=%RESPONSESTATUS%", 32 subscriptions_fallbackurl: "https://adblockplus.org/getSubscription?version=%V ERSION%&url=%SUBSCRIPTION%&downloadURL=%URL%&error=%ERROR%&channelStatus=%CHANNE LSTATUS%&responseStatus=%RESPONSESTATUS%",
33 subscriptions_autoupdate: true, 33 subscriptions_autoupdate: true,
34 subscriptions_exceptionsurl: "https://easylist-downloads.adblockplus.org/excep tionrules.txt", 34 subscriptions_exceptionsurl: "https://easylist-downloads.adblockplus.org/excep tionrules.txt",
35 first_run_enable_acceptable_ads: true,
Felix Dahlke 2016/11/21 11:41:11 Why not move this down, so it's right next to the
sergei 2016/11/21 14:03:20 I wanted to keep it close to subscriptions_excepti
Felix Dahlke 2016/11/22 11:45:08 IMO yes, but you could also move the other thing u
36 documentation_link: "https://adblockplus.org/redirect?link=%LINK%&lang=%LANG%" , 35 documentation_link: "https://adblockplus.org/redirect?link=%LINK%&lang=%LANG%" ,
37 update_url_release: "https://update.adblockplus.org/%NAME%/update.json?type=%T YPE%", 36 update_url_release: "https://update.adblockplus.org/%NAME%/update.json?type=%T YPE%",
38 update_url_devbuild: "https://adblockplus.org/devbuilds/%NAME%/update.json?typ e=%TYPE%", 37 update_url_devbuild: "https://adblockplus.org/devbuilds/%NAME%/update.json?typ e=%TYPE%",
39 update_last_check: 0, 38 update_last_check: 0,
40 update_last_error: 0, 39 update_last_error: 0,
41 update_soft_expiration: 0, 40 update_soft_expiration: 0,
42 update_hard_expiration: 0, 41 update_hard_expiration: 0,
43 currentVersion: "0.0", 42 currentVersion: "0.0",
44 notificationdata: {}, 43 notificationdata: {},
45 notificationurl: "https://notification.adblockplus.org/notification.json", 44 notificationurl: "https://notification.adblockplus.org/notification.json",
46 suppress_first_run_page: false, 45 suppress_first_run_page: false,
47 disable_auto_updates: false, 46 disable_auto_updates: false,
48 first_run_enable_current_locale_subscription: true, 47 first_run_subscription_auto_select: true,
Felix Dahlke 2016/11/21 11:41:11 Hm, I think the name could be improved. How about
sergei 2016/11/21 14:03:20 I think that "enable_ad_blocking" is confusing bec
sergei 2016/11/22 09:43:03 Or maybe first_run_enable_subscription_auto_choosi
Felix Dahlke 2016/11/22 11:45:08 There is a way to disable ad blocking - this pref
sergei 2016/11/22 11:58:43 No, if these pref values are false there is still
49 notifications_ignoredcategories: [], 48 notifications_ignoredcategories: [],
50 }; 49 };
51 50
52 let preconfigurable = ["suppress_first_run_page", "disable_auto_updates", 51 let preconfigurable = ["suppress_first_run_page", "disable_auto_updates",
53 "first_run_enable_acceptable_ads", "first_run_enable_current_locale_subscripti on"]; 52 "first_run_subscription_auto_select"];
Felix Dahlke 2016/11/21 11:41:11 Back when we discussed what should be preconfigura
sergei 2016/11/21 14:03:20 Could you please remind where it had been discusse
Felix Dahlke 2016/11/22 11:45:08 My bad, I forgot how that stuff works :P Yeah of c
54 53
55 let values; 54 let values;
56 let path = _fileSystem.resolve("prefs.json"); 55 let path = _fileSystem.resolve("prefs.json");
57 let listeners = []; 56 let listeners = [];
58 let isDirty = false; 57 let isDirty = false;
59 let isSaving = false; 58 let isSaving = false;
60 59
61 function defineProperty(key) 60 function defineProperty(key)
62 { 61 {
63 Object.defineProperty(Prefs, key, 62 Object.defineProperty(Prefs, key,
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 defaults[key] = _preconfiguredPrefs[key]; 144 defaults[key] = _preconfiguredPrefs[key];
146 145
147 // Define defaults 146 // Define defaults
148 for (let key in defaults) 147 for (let key in defaults)
149 defineProperty(key); 148 defineProperty(key);
150 149
151 // Set values of prefs based on defaults 150 // Set values of prefs based on defaults
152 values = Object.create(defaults); 151 values = Object.create(defaults);
153 152
154 load(); 153 load();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld