diff options
Diffstat (limited to 'browser/components/aboutwelcome/actors/AboutWelcomeChild.sys.mjs')
-rw-r--r-- | browser/components/aboutwelcome/actors/AboutWelcomeChild.sys.mjs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/browser/components/aboutwelcome/actors/AboutWelcomeChild.sys.mjs b/browser/components/aboutwelcome/actors/AboutWelcomeChild.sys.mjs index 24bf73c80a..7c61c13a92 100644 --- a/browser/components/aboutwelcome/actors/AboutWelcomeChild.sys.mjs +++ b/browser/components/aboutwelcome/actors/AboutWelcomeChild.sys.mjs @@ -20,6 +20,15 @@ ChromeUtils.defineLazyGetter(lazy, "log", () => { return new Logger("AboutWelcomeChild"); }); +const DID_SEE_FINAL_SCREEN_PREF = "browser.aboutwelcome.didSeeFinalScreen"; + +XPCOMUtils.defineLazyPreferenceGetter( + lazy, + "toolbarEntrypoint", + "browser.aboutwelcome.entrypoint", + "" +); + export class AboutWelcomeChild extends JSWindowActorChild { // Can be used to avoid accesses to the document/contentWindow after it's // destroyed, which may throw unhandled exceptions. @@ -233,6 +242,9 @@ export class AboutWelcomeChild extends JSWindowActorChild { * @param {object} eventData */ AWSendEventTelemetry(eventData) { + if (lazy.toolbarEntrypoint) { + eventData.event_context.entrypoint = lazy.toolbarEntrypoint; + } this.AWSendToParent("TELEMETRY_EVENT", { ...eventData, event_context: { @@ -242,7 +254,7 @@ export class AboutWelcomeChild extends JSWindowActorChild { } /** - * Send message that can be handled by AboutWelcomeParent.jsm + * Send message that can be handled by AboutWelcomeParent.sys.mjs * * @param {string} type * @param {any=} data @@ -256,10 +268,24 @@ export class AboutWelcomeChild extends JSWindowActorChild { return this.wrapPromise(this.sendQuery("AWPage:WAIT_FOR_MIGRATION_CLOSE")); } + setDidSeeFinalScreen() { + this.AWSendToParent("SPECIAL_ACTION", { + type: "SET_PREF", + data: { + pref: { + name: DID_SEE_FINAL_SCREEN_PREF, + value: true, + }, + }, + }); + } + AWFinish() { const shouldFocusNewtabUrlBar = lazy.NimbusFeatures.aboutwelcome.getVariable("newtabUrlBarFocus"); + this.setDidSeeFinalScreen(); + this.contentWindow.location.href = "about:home"; if (shouldFocusNewtabUrlBar) { this.AWSendToParent("SPECIAL_ACTION", { |