summaryrefslogtreecommitdiffstats
path: root/toolkit/modules/FirstStartup.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /toolkit/modules/FirstStartup.sys.mjs
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/modules/FirstStartup.sys.mjs')
-rw-r--r--toolkit/modules/FirstStartup.sys.mjs26
1 files changed, 25 insertions, 1 deletions
diff --git a/toolkit/modules/FirstStartup.sys.mjs b/toolkit/modules/FirstStartup.sys.mjs
index b31e7ffa07..c09885abe9 100644
--- a/toolkit/modules/FirstStartup.sys.mjs
+++ b/toolkit/modules/FirstStartup.sys.mjs
@@ -36,8 +36,25 @@ export var FirstStartup = {
* completed, or until a timeout is reached.
*
* In the latter case, services are expected to run post-UI instead as usual.
+ *
+ * @param {boolean} newProfile
+ * True if a new profile was just created, false otherwise.
*/
- init() {
+ init(newProfile) {
+ if (!newProfile) {
+ // In this case, we actually don't want to do any FirstStartup work,
+ // since a pre-existing profile was detected (presumably, we entered here
+ // because a user re-installed via the stub installer when there existed
+ // previous user profiles on the file system). We do, however, want to
+ // measure how often this occurs.
+ Glean.firstStartup.statusCode.set(this.NOT_STARTED);
+ Glean.firstStartup.newProfile.set(false);
+ GleanPings.firstStartup.submit();
+ return;
+ }
+
+ Glean.firstStartup.newProfile.set(true);
+
this._state = this.IN_PROGRESS;
const timeout = Services.prefs.getIntPref(PREF_TIMEOUT, 30000); // default to 30 seconds
let startingTime = Cu.now();
@@ -106,4 +123,11 @@ export var FirstStartup = {
get state() {
return this._state;
},
+
+ /**
+ * For testing only. This puts us back into the initial NOT_STARTED state.
+ */
+ resetForTesting() {
+ this._state = this.NOT_STARTED;
+ },
};