Left: | ||
Right: |
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-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 Loading... | |
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 if (Prefs.first_run_enable_current_locale_subscription) | 54 if (Prefs.first_run_subscription_auto_select) |
55 { | 55 { |
56 // Choose default subscription and add it | |
Felix Dahlke
2016/11/21 11:41:11
I guess we don't need that comment anymore if the
sergei
2016/11/21 14:03:20
Agree.
| |
57 let subscriptions = require("subscriptions.xml"); | 56 let subscriptions = require("subscriptions.xml"); |
58 let node = Utils.chooseFilterSubscription(subscriptions); | 57 let node = Utils.chooseFilterSubscription(subscriptions); |
59 console.log(node.url); | |
Felix Dahlke
2016/11/21 11:41:11
Do we want this to stay in here?
sergei
2016/11/21 14:03:20
Sorry, forgot to remove after debugging.
| |
60 if (node) | 58 if (node) |
61 { | 59 { |
62 let subscription = Subscription.fromURL(node.url); | 60 let subscription = Subscription.fromURL(node.url); |
63 FilterStorage.addSubscription(subscription); | |
64 subscription.disabled = false; | 61 subscription.disabled = false; |
65 subscription.title = node.title; | 62 subscription.title = node.title; |
66 subscription.homepage = node.homepage; | 63 subscription.homepage = node.homepage; |
64 FilterStorage.addSubscription(subscription); | |
67 if (subscription instanceof DownloadableSubscription && !subscription. lastDownload) | 65 if (subscription instanceof DownloadableSubscription && !subscription. lastDownload) |
68 Synchronizer.execute(subscription); | 66 Synchronizer.execute(subscription); |
69 } | 67 } |
70 } | 68 |
71 if (Prefs.first_run_enable_acceptable_ads) | 69 let aaSubscription = Subscription.fromURL(Prefs.subscriptions_exceptions url); |
72 { | 70 aaSubscription.disabled = false; |
73 let subscription = Subscription.fromURL(Prefs.subscriptions_exceptionsur l); | 71 FilterStorage.addSubscription(aaSubscription); |
74 FilterStorage.addSubscription(subscription); | 72 if (aaSubscription instanceof DownloadableSubscription && !aaSubscriptio n.lastDownload) |
75 subscription.disabled = false; | 73 Synchronizer.execute(aaSubscription); |
76 if (subscription instanceof DownloadableSubscription && !subscription.la stDownload) | |
77 Synchronizer.execute(subscription); | |
78 | |
Felix Dahlke
2016/11/21 11:41:11
Nit: Why add an empty line here?
sergei
2016/11/21 14:03:20
Done.
| |
79 } | 74 } |
80 } | 75 } |
81 | 76 |
82 filtersInitDone = true; | 77 filtersInitDone = true; |
83 checkInitialized(); | 78 checkInitialized(); |
84 } | 79 } |
85 }); | 80 }); |
LEFT | RIGHT |