Making it easier to migrate data from other browsers into Firefox

Hi,

I’m a developer at Mozilla working on Firefox Desktop.

I’m on a team that has been making various improvements to our migration wizard, which is the tool for migrating data (bookmarks, history, logins, etc) from other browsers into Firefox.

One thing we’ve been looking at recently, is ways that we can improve the experience when Firefox is installed as a Snap. Currently, when Firefox is installed as a Snap, the application sandbox prevents us from reading other browser data directories (for example, the Chromium profile data directory) to get the list of profiles as well as the resources that those profiles might have to migrate.

We faced a similar hurdle with Safari after Apple shipped macOS 10.14 - Firefox was prevented by the operating system from reading the contents of the Safari data folder when the user had initiated a migration. Our solution on that platform was to open a native file picker in folder-selection mode and to gave instructions to the user to have them select the “Safari” folder from that file picker. Doing so gives Firefox read permissions on the directory to import the contents. It’s somewhat awkward, but it ultimately works, and our data suggests that a sufficient set of users are able to complete that flow.

We’re hoping to do something similar for the Snap package issue. We can detect when Firefox is installed as a Snap, and we can detect the existence of the Chromium data folder, and (in theory) we can show the user a folder picker that allows them to select that folder, and grant Firefox access to it using the XDG Desktop Portal mechanism.

We’re having some difficulty making this experience smooth, and we were wondering if any of you had any advice or suggestions on how we could do so. Specifically:

  1. In Ubuntu 20.04, it appears that the default version of xdg-desktop-portal doesn’t support folder selection. It looks like this is, however, supported in 22.04. Can I presume that as 20.04 is a LTS that there’s little likelihood of folder selection support being backported to that series?

  2. Ideally, we could open the file picker at the parent folder of the Chromium data folder, and instruct the user to select the data folder and choose “Open”. Unfortunately, it seems that we cannot initialize the file picker at that particular location. Is there anyway around that limitation? Failing that, are there any keyboard shortcuts that users can use to quickly hop to a particular path in a native file picker? (macOS, for example, has Cmd-Shift-G for such a purpose).

Alongside those questions, if any of you have any other suggestions on how we can make it as smooth as possible for users to grant us access to the Chromium profile data, we’d love to hear it.

Thanks for reading this wall of text! All the best,

-mconley

5 Likes

Hello Mike, I think I only have one answer:

keyboard shortcuts that users can use to quickly hop to a particular path

Does Ctrl+L do what you ask for?

Hi Mike,

I’ve been looking over cases like this that have come up in the past to see how things were dealt with, and the closest was the boxwallet snap. In that case, the decision was made to allow the snap to provide personal-files interface plugs, but not auto-connect them. So this meant that a user could grant read access to those other apps’ configuration files by connecting the plug, but the grant happens outside of the snap’s control. So this is likely one option available to Firefox.

For the portals alternative, I think it would be reasonable to update xdg-desktop-portal and friends in older releases. We’ve done it before to support other cases, and it would be worth doing now too.

For the problem of picking a starting folder, it looks like support for this was added 2 months ago:

It looks like all of xdg-desktop-portal-gtk, xdg-desktop-portal-gnome, and xdg-desktop-portal-kde have been updated to support this feature too. If you want to pursue this option, we could look at pushing out updates to support it.

3 Likes

Thanks everybody for your help thinking about this! We’re going to move forward with our portals solution, and hopefully have that working in Firefox 120.

If those changes to xdg-desktop* could get backported to those older releases, that’d be wonderful! We’re currently sniffing the portal version to make decisions on whether we support requesting permissions via the file picker, so if and when those things get backported, if we’ve done our job right, Firefox should just start figuring out that it can request permissions and offer the capability to users.

Thanks again,

-Mike

2 Likes