Mentioning this too, as I feel there are some improvements we can still do.
Looking at the profile import script in firefox, it seems that it doesn't work if
~/snap/firefox/current/.mozilla is present; that is creating problems if someone had installed firefox snap in old times but is going to now switch to snap (happening automatically on Ubuntu 22.04.01).
Maybe should it be done in a different way such:
- If a
.snap-imported (maybe versioned?) stamp file is not there, continue with importing
- go through the
~/.mozilla/firefox/profiles.ini profiles and import the missing ones in snap folder (adding them to the ini file, ofc)
- Maybe set
0 in case you are importing a profile that was not existing but the snap had another default profile already set (so users can re-select the default on startup).
To detect those who which may have already imported the profile and they're using it, we can use other strategies like looking when it has been lastly modified (used), or maybe just rename it under a new profile, leaving the user the ability to choose on startup via the native firefox dialog.