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

Unified Diff: lib/subscriptionInit.js

Issue 29664623: Issue 6403 - Updated adblockplusui dependency (Closed)
Patch Set: Created Jan. 12, 2018, 4:26 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« lib/prefs.js ('K') | « lib/prefs.js ('k') | metadata.chrome » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/subscriptionInit.js
===================================================================
--- a/lib/subscriptionInit.js
+++ b/lib/subscriptionInit.js
@@ -23,11 +23,20 @@
SpecialSubscription} = require("subscriptionClasses");
const {FilterStorage} = require("filterStorage");
const {FilterNotifier} = require("filterNotifier");
+const info = require("info");
const {Prefs} = require("prefs");
const {Synchronizer} = require("synchronizer");
const {Utils} = require("utils");
const {initNotifications} = require("notificationHelper");
+/**
+ * The version of major updates that the user should be aware of.
+ * See also Prefs.lastUpdatesVersion
+ *
+ * @type {number}
+ */
+const updatesVersion = 1;
kzar 2018/01/15 11:58:35 I figured we should instead reuse the extension's
Thomas Greiner 2018/01/17 18:00:06 I'm wondering whether we (a) will always increment
Sebastian Noack 2018/01/18 12:46:48 This is not true. We only advanced the version to
Thomas Greiner 2018/01/18 13:36:01 My bad, I looked at a local build of mine which I
Sebastian Noack 2018/01/18 16:23:12 Oh, that was a mistake. We should not have advance
+
let firstRun;
let subscriptionsCallback = null;
@@ -48,7 +57,7 @@
if (firstRun && (!FilterStorage.firstRun || Prefs.currentVersion))
exports.reinitialized = true;
- Prefs.currentVersion = require("info").addonVersion;
+ Prefs.currentVersion = info.addonVersion;
}
/**
@@ -204,8 +213,27 @@
Synchronizer.execute(subscription);
}
- if (firstRun && !Prefs.suppress_first_run_page)
- browser.tabs.create({url: browser.extension.getURL("firstRun.html")});
+ if (!Prefs.suppress_first_run_page)
+ {
+ let page = null;
+ if (firstRun)
+ {
+ page = "firstRun.html";
+ }
+ // For now we're limiting the updates page to users of
+ // Chromium-based browsers to gage its impact
kzar 2018/01/15 11:58:35 That's not mentioned in the issue, would you mind
Thomas Greiner 2018/01/17 18:00:06 Weird, I actually thought it'd be in the spec sinc
kzar 2018/01/18 10:53:13 Acknowledged.
Sebastian Noack 2018/01/18 12:46:48 Well, the current update page, announces the new o
Thomas Greiner 2018/01/18 13:36:01 I haven't heard back yet on whether we want to men
+ else if (info.platform == "chromium" &&
+ updatesVersion > Prefs.lastUpdatesVersion)
kzar 2018/01/15 11:58:35 I guess this comparison gets a little trickier wit
kzar 2018/01/15 12:17:20 In fact if you like I'll add this to adblockplusch
Thomas Greiner 2018/01/17 18:00:06 We used to use Firefox' `Services.vc.compare()` fo
kzar 2018/01/18 10:53:13 Good point, yes we should reuse that instead of re
Sebastian Noack 2018/01/18 12:46:48 For reference, originally the version comparison l
Thomas Greiner 2018/01/18 13:36:01 That means that none of our devbuild users will re
Sebastian Noack 2018/01/18 16:23:12 Well, we have to special case either Firefox or Ch
kzar 2018/01/19 11:05:23 Yea, I'm coming around to the idea of having the s
+ {
+ page = "updates.html";
+ }
+
+ if (page)
+ {
+ browser.tabs.create({url: browser.extension.getURL(page)});
Thomas Greiner 2018/01/12 16:33:39 Note that in later versions we can simply use `Pre
kzar 2018/01/18 10:53:13 I'm not quite sure how that would work. So the pla
kzar 2018/01/18 11:38:24 Hmm, I suppose we need to make sure the updates pa
Thomas Greiner 2018/01/18 11:50:26 Yep, the simplest way would be to pass it as a GET
kzar 2018/01/18 12:01:39 Generally I agree about not implementing stuff bef
Sebastian Noack 2018/01/18 12:46:48 FWIW, I think, in the (rather theoretical) scenari
Thomas Greiner 2018/01/18 13:36:01 Ok, so if Dave agrees with that as well I'd not im
kzar 2018/01/19 11:05:23 Alright then, seems I'm outnumbered.
+ Prefs.lastUpdatesVersion = updatesVersion;
+ }
+ }
initNotifications();
}
« lib/prefs.js ('K') | « lib/prefs.js ('k') | metadata.chrome » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld