Closed Bug 1801224 Opened 1 year ago Closed 1 year ago

Invoke window modal for new users on first startup

Categories

(Firefox :: Messaging System, task, P2)

task

Tracking

()

VERIFIED FIXED
110 Branch
Iteration:
110.1 - Dec 12 - Dec 23
Tracking Status
firefox110 --- verified

People

(Reporter: pdahiya, Assigned: nsauermann)

References

(Depends on 1 open bug, Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(1 file)

Scope of this bug is to investigate calling a window modal on first startup for new users enrolled in Nimbus experiment branch.

We should be able to call upgradeDialog similar to https://searchfox.org/mozilla-central/rev/2f47e3dacf0d773e9c7f363cecf10cfbea490679/browser/components/BrowserGlue.jsm#4433

from inside BrowserContentHandler

https://searchfox.org/mozilla-central/source/browser/components/BrowserContentHandler.jsm#689

Iteration: --- → 109.1 - Nov 14 - Nov 25
Priority: -- → P1

I think it'd make sense to do the actual dialog opening in BrowserGlue, and set a flag so that BrowserContentHandler doesn't load about:welcome in this case. That way we don't have to add side effects to getArgs

Assignee: nobody → nsauermann

The implementation is a bit trickier than anticipated, this is because we can't seem to load a window on startup with the current implementation because of when getTopWindow gets called. Currently, on start up it returns null (and we need a window to render the messaging).

[@:aminomancer] suggested instead to edit openBrowserWindow and check if the url is about:welcome and isStartup (so checking whether the user is viewing the onboarding flow on first load), and if so - use a dummy url instead (i.e. about:welcomedialog) so we can add a flag/aren't opening two onboarding flows at the same time. In browser.js we can then set a flag and replace the dummy URL with a generic homepage URL and from there open the dialog/window modal. Because of this implementation, we still need to open a first tab instead of about:welcome, so I guess the question is what tab would we be loading if we go with this direction?

Iteration: 109.1 - Nov 14 - Nov 25 → 109.2 - Nov 28 - Dec 9
Depends on: 1802931
Priority: P1 → P2
Attachment #9304995 - Attachment description: WIP: Bug 1801224 - Invoke window modal for new users on first startup → Bug 1801224 - Invoke window modal for new users on first startup
Attachment #9304995 - Attachment description: Bug 1801224 - Invoke window modal for new users on first startup → WIP: Bug 1801224 - Invoke window modal for new users on first startup
Attachment #9304995 - Attachment description: WIP: Bug 1801224 - Invoke window modal for new users on first startup → Bug 1801224 - Invoke window modal for new users on first startup
Iteration: 109.2 - Nov 28 - Dec 9 → 110.1 - Dec 12 - Dec 23
Depends on: 1805952
Pushed by smolnar@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/35fd7fb9f3d3
Invoke window modal for new users on first startup r=pdahiya
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch

Steps to test fix in Nightly

  1. Set pref 'browser.aboutwelcome.showModal' as true and 'browser.aboutwelcome.screens' value from https://gist.github.com/punamdahiya/ee4ed710e1ecbb432324058a61624015
  2. In browser console run below script

Cc["@mozilla.org/browser/clh;1"].getService().wrappedJSObject.firstRunProfile = true; Cc["@mozilla.org/browser/browserglue;1"].getService().wrappedJSObject._maybeShowDefaultBrowserPrompt()

  1. Window modal should open with two screens from pref browser.aboutwelcome.screens

I have verified this task using the steps provided in comment 6 and I can confirm that after running the provided script a modal containing two screens is successfully opened.

Verified using the latest Firefox Beta (110.0b2 Build ID - 20230117185909) installed on Windows 10 x64, macOS 12.6.1, and Ubuntu 22.04 x64.

Status: RESOLVED → VERIFIED
Regressions: 1817144
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: