Files
tubestation/browser/components
Jared Hirsch 622d019e7b Bug 1910716 - Support launching selectable profiles via --profile command line option. r=niklas,mossop
1. Modify nsToolkitProfileService to support roaming profiles passed in
   via the "-profile /path/to/profile/" command line option but not
   present in profiles.ini.

With this patch, when a profile is supplied via the "-profile
/path/to/profile/" command line option, if the root dir path is not found
in profiles.ini, and if its path is a relative path, then we either use or
create a corresponding local dir.

Previously for unmanaged profiles, we would not look for a local dir,
instead just using the root dir to hold the various local ephemeral
caches. This change is necessary to prevent degraded filesystem
performance for roaming / enterprise users who adopt selectable
profiles.

This patch also adds roaming profile support for profiles passed in
via XRE_PROFILE_PATH, finding/creating a local dir if the root dir is
relative, event if XRE_PROFILE_LOCAL_PATH is null or does not exist.
These environment variables are typically set as part of an app-managed
restart, for example, after choosing a profile in the Profile Manager.

2. Add a new method to the SelectableProfileService to launch a new
   Firefox instance, using --profile to pass an unmanaged profile path.

This is necessary because selectable profiles will not be listed in
profiles.ini, but users will need to launch them by selecting them in
UI entries (like menu items).

3. Refactor some duplicated code into `EnsureDirExists` and
   `GetLocalDirFromRootDir` helpers in nsToolkitProfileService.

See also bug 1913383 for further planned cleanup work.

4. Add a groupProfile property to nsToolkitProfileService.

This ensures SelectableProfileService.#groupToolkitProfile will always
be set, so that we can set or unset rootDir and StoreID as users upgrade
to multiple profiles, launch Firefox from a selectable profile, or
downgrade back to a single profile.

Differential Revision: https://phabricator.services.mozilla.com/D218149
2024-09-04 20:41:02 +00:00
..