Closed Bug 1818237 Opened 1 year ago Closed 6 months ago

Make it possible to import from other browsers when Firefox is installed as a Snap package

Categories

(Firefox :: Migration, enhancement)

Desktop
Linux
enhancement

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
relnote-firefox --- 120+
firefox120 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [FIDEFE])

Attachments

(4 files)

Spinning this out from bug 1467094. Bug 1467094 focused itself by making it possible to find and import from Chromium when Chromium is installed as a Snap package, but Firefox is not.

When Firefox is installed as a Snap package, the permissions that it has to access the file system changes greatly. As a sandboxed application, it no longer has direct read access to the user's home directory to pull in things like history, bookmarks or passwords from other browsers.

We can, however, stat files to detect the presence of other browsers, and then use the native file picker to get temporary read access to those files. This is what we do for Safari. This bug is about using that same technique here when Firefox is installed as a Snap package.

Assignee: nobody → axtinemvsn

It's worth noting that our first-run experience does have some dialogs that actively encourage users to try importing data from other browsers -- I just encountered these in the Snap version of Firefox, and clicked through, only to find that it couldn't find any other browsers (when I do in fact have Chrome installed, which a non-snap firefox build is able to find).

It's obviously not-great to be pushing users towards trying something that doesn't work, so if this ends up being something that we can't fix in the near term, we might consider suppressing any data-importation call-to-action dialogs for snappified Firefox, as a temporary mitigation to avoid causing user confusion/bother.

Assignee: axtinemvsn → nobody
Whiteboard: [FIDEFE]
Depends on: 1852839
Blocks: snap
No longer blocks: calstate
Duplicate of this bug: 1844279

We're unblocked here. We're using the feature detection from bug 1852839 to do a runtime determination if we can get access to the data with the native file picker, and if so, offer the user instructions on how to do that.

Assignee: nobody → mconley

This is needed for Ubuntu Linux when Firefox is installed as a Snap package.
Under those conditions, Firefox doesn't have the ability to read the contents
of the other browsers' data directories.

We work around by showing the user a native file picker and instructing them
to browse to that data directory in folder picker mode - doing so tends to give
the Firefox process access to the folder.

Depends on: 1854494
Attachment #9354424 - Attachment description: Bug 1818237 - Make it possible to request permission to access Chrome-browser profiles. r?mstriemer! → WIP: Bug 1818237 - Make it possible to request permission to access Chrome-browser profiles. r?mstriemer!

The front-end needs to know sometimes when the browser is installed as a Snap
in order to know what strategies it should use to gain read permissions on
other browsers data during browser migration.

Attachment #9354424 - Attachment description: WIP: Bug 1818237 - Make it possible to request permission to access Chrome-browser profiles. r?mstriemer! → Bug 1818237 - Make it possible to request permission to access Chrome-browser profiles. r?mstriemer!
Attachment #9356215 - Attachment description: Bug 1818237 - Expose whether or not the browser is installed as a Snap package through nsIGNOMEShellService. r?Gijs! → Bug 1818237 - Expose whether or not the browser is installed as a Snap package through nsIGIOService. r?Gijs!

I'm going to land the nsIGIOService part now, as that'll mean that folks applying the other patches won't require full binary builds to test them out after the first part merges.

Keywords: leave-open
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b69fa06f2cc5
Expose whether or not the browser is installed as a Snap package through nsIGIOService. r=Gijs
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f9fc3ecfa2a7
MockFilePicker should be able to return the nsIFile for a selected directory. r=Gijs
Keywords: leave-open
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/477292e081b3
Make it possible to request permission to access Chrome-browser profiles. r=mstriemer,fluent-reviewers,desktop-theme-reviewers
https://hg.mozilla.org/integration/autoland/rev/a8584f57dc7c
Add automated tests for requesting migrator permissions. r=mstriemer
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/87f67f05c8a8
Make it possible to request permission to access Chrome-browser profiles. r=mstriemer,fluent-reviewers,desktop-theme-reviewers
https://hg.mozilla.org/integration/autoland/rev/e5d78a9ddcb4
Add automated tests for requesting migrator permissions. r=mstriemer
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0da2d5295ccf
Make it possible to request permission to access Chrome-browser profiles. r=mstriemer,fluent-reviewers,desktop-theme-reviewers
https://hg.mozilla.org/integration/autoland/rev/2b8519877767
Add automated tests for requesting migrator permissions. r=mstriemer
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch

Release Note Request (optional, but appreciated)
[Why is this notable]:

Users on Ubuntu Linux that install Firefox as a Snap package have historically been unable to import from other installed browsers. This patch makes it possible to import from Chromium when Firefox and Chromium are both installed as Snap packages.

[Affects Firefox for Android]:

No.

[Suggested wording]:

Users on Ubuntu Linux now have the ability to import from Chromium when both are installed as Snap packages.

[Links (documentation, blog post, etc)]:

None.

relnote-firefox: --- → ?
Flags: needinfo?(mconley)
Blocks: 1858785
See Also: → 1855492
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: