Open Bug 1944431 Opened 28 days ago Updated 27 days ago

Ensure that `FirstStartup.init` runs before browser windows are opened

Categories

(Toolkit :: General, enhancement)

enhancement

Tracking

()

People

(Reporter: nalexander, Unassigned)

References

Details

The initial landing of FirstStartup placed it part way through BrowserContentHandler.handle; see Bug 1576507. What this means is that FirstStartup.init can race opening the first browser window and therefore sessionstore-windows-restored -- e.g., firefox.exe --browser --first-startup can end up with a browser window displayed before Nimbus is initialized. That's definitely not intended behaviour, even though it's mostly benign, because the stub installer invokes Firefox with only --first-startup and a handful of flags that don't impact window opening.

This ticket tracks lifting FirstStartup.init to be as early as possible during command line handling, so that there's less risk of racing when opening browser windows.

mconley: did you and rhelmer ever think about what guarantees FirstStartup should make about windows, session restore, etc? Any reason to not make this more predictable?

Flags: needinfo?(mconley)

Hm. It does look as if there are a few branches above that call to FirstStartup.init() where a browser window might open, yes. I'd certainly be okay moving the call earlier in that command line handler (maybe have it be the first thing).

Flags: needinfo?(mconley)

Is this something you noticed that is blocking high priority work?

Flags: needinfo?(nalexander)

(In reply to Mike Conley (:mconley) (:⚙️) from comment #3)

Is this something you noticed that is blocking high priority work?

No -- it works in my case (--first-startup from the stub installer) because there are no window-creating parameters. So it's just for robustness.

Flags: needinfo?(nalexander)
You need to log in before you can comment on or make changes to this bug.