File: FirstStartup.rst

package info (click to toggle)
firefox-esr 128.13.0esr-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,230,012 kB
  • sloc: cpp: 7,103,971; javascript: 6,088,450; ansic: 3,653,980; python: 1,212,330; xml: 594,604; asm: 420,652; java: 182,969; sh: 71,124; makefile: 20,747; perl: 13,449; objc: 12,399; yacc: 4,583; cs: 3,846; pascal: 2,973; lex: 1,720; ruby: 1,194; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (72 lines) | stat: -rw-r--r-- 2,933 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.. _FirstStartup:

==============
FirstStartup
==============

``FirstStartup`` is a module which is invoked on application startup by the Windows Installer,
to initialize services before the first application window appears.

This is useful for:

- one-time performance tuning
- downloading critical data (hotfixes, experiments, etc)

Blocking until the first Application window appears is important because the Installer
will show a progress bar until this happens. This gives a user experience of:

1. User downloads and starts the Windows Stub Installer.
2. Progress bar advances while the application is downloaded and installed.
3. Installer invokes the application with ``--first-startup``.
4. Application window appears, and the installer window closes.

Overall, the user experiences a very fast first-startup, with critical tasks that normally
would be deferred until after UI startup already complete.

.. _FirstStartup Architecture:

FirstStartup: Example use case
==============================

An example use of the ``FirstStartup`` module is to invoke the Normandy client to download an experiment
that will be used to customize the first-run page that Firefox shows.

In this example, the first-run page would be loaded experimentally based on an attribution code provided
by the Installer. The flow for this looks like:

1. User clicks on download link containing an attribution (UTM) code(s).
2. The download page serves a custom Windows Stub Installer with the appropriate attribution code embedded.
3. The installer invokes Firefox with the `--first-startup` flag, which blocks the first window.
4. Normandy is run by ``FirstStartup`` and downloads a list of available experiments, or "recipes".
5. Recipes are evaluated and filtered based on local information, such as the OS platform and the attribution codes.
6. A recipe is found which matches the current attribution code, and appropriate data is made available to the first-run page.
7. ``FirstStartup`` completes and unblocks, which causes Firefox to show the first window and load the appropriate first-run data.

List of phases
==============

``FirstStartup.NOT_STARTED``

  The ``FirstStartup`` module has not been initialized (the ``init()``
  function has not been called). This is the default state.

``FirstStartup.IN_PROGRESS``

  ``FirstStartup.init()`` has been called, and the event loop is
  spinning. This state will persist until either all startup tasks
  have finished, or time-out has been reached.

  The time-out defaults to 30 seconds, but is configurable via the
  ``first-startup.timeout`` pref, which is specified in milliseconds.

``FirstStartup.TIMED_OUT``

  The time-out has been reached before startup tasks are complete.

``FirstStartup.SUCCESS``

  All startup tasks have completed successfully, and application startup may resume.

``FirstStartup.UNSUPPORTED``

  No startup tasks are supported, and `FirstStartup` exited.