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

Side by Side Diff: lib/init.js

Issue 29363607: Issue 4612 - enable AA on first run and make automatic adding of any subscription optional (Closed)
Patch Set: address comments Created Nov. 23, 2016, 2:17 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 | « no previous file | lib/prefs.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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 if (FilterStorage.firstRun) 44 if (FilterStorage.firstRun)
45 { 45 {
46 // No data, must be a new user or someone with corrupted data - initialize 46 // No data, must be a new user or someone with corrupted data - initialize
47 // with default settings 47 // with default settings
48 48
49 let {Subscription, DownloadableSubscription} = require("subscriptionClasse s"); 49 let {Subscription, DownloadableSubscription} = require("subscriptionClasse s");
50 let {Synchronizer} = require("synchronizer"); 50 let {Synchronizer} = require("synchronizer");
51 let {Prefs} = require("prefs"); 51 let {Prefs} = require("prefs");
52 let {Utils} = require("utils"); 52 let {Utils} = require("utils");
53 53
54 // Choose default subscription and add it 54 if (Prefs.first_run_subscription_auto_select)
55 let subscriptions = require("subscriptions.xml");
56 let node = Utils.chooseFilterSubscription(subscriptions);
57 if (node)
58 { 55 {
59 let subscription = Subscription.fromURL(node.url); 56 let subscriptions = require("subscriptions.xml");
60 FilterStorage.addSubscription(subscription); 57 let node = Utils.chooseFilterSubscription(subscriptions);
61 subscription.disabled = false; 58 if (node)
62 subscription.title = node.title; 59 {
63 subscription.homepage = node.homepage; 60 let subscription = Subscription.fromURL(node.url);
64 if (subscription instanceof DownloadableSubscription && !subscription.la stDownload) 61 subscription.disabled = false;
65 Synchronizer.execute(subscription); 62 subscription.title = node.title;
63 subscription.homepage = node.homepage;
64 FilterStorage.addSubscription(subscription);
65 if (subscription instanceof DownloadableSubscription && !subscription. lastDownload)
66 Synchronizer.execute(subscription);
67 }
68
69 let aaSubscription = Subscription.fromURL(Prefs.subscriptions_exceptions url);
70 aaSubscription.disabled = false;
71 FilterStorage.addSubscription(aaSubscription);
72 if (aaSubscription instanceof DownloadableSubscription && !aaSubscriptio n.lastDownload)
73 Synchronizer.execute(aaSubscription);
66 } 74 }
67 } 75 }
68 76
69 filtersInitDone = true; 77 filtersInitDone = true;
70 checkInitialized(); 78 checkInitialized();
71 } 79 }
72 }); 80 });
OLDNEW
« no previous file with comments | « no previous file | lib/prefs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld