dkgv / pinpoint

Keystroke launcher and personal command central. Alternative to Spotlight and Alfred for Windows. Alternative to Wox, PowerToys.
https://usepinpoint.com
GNU General Public License v3.0
154 stars 17 forks source link

Bookmarks plugin: FirefoxBookmarkExtractor doesn't include alternate firefox installs #155

Closed mgrandi closed 2 years ago

mgrandi commented 2 years ago

I use firefox nightly as my default browser, and it seems that the bookmarks plugin doesn't include any of my bookmarks

I looked at the source code for the bookmarks plugin:

https://github.com/dkgv/pinpoint/blob/75c8cbc960d94f1dc26d6275f260ec9e2c255d78/Pinpoint.Plugin.Bookmarks/FirefoxBookmarkExtractor.cs#L58-L79

and it seems the problem is that it is using the first profile that shows up in the directory listing, but that doesn't take into account the case that a user has multiple firefox installations or multiple profiles (and one installation). As of firefox 67, there is a new profile created per "flavor" of firefox:

https://support.mozilla.org/en-US/kb/dedicated-profiles-firefox-installation https://support.mozilla.org/en-US/kb/understanding-depth-profile-installation

image

it talks about how there are separate profiles for "Normal" firefox, Nightly, Beta, Developer Edition, and Extended Support Release (ESR) versions now too, but there are also "old" profile folders that don't have anything in them (my old one 1jyccrk5.default, just has a single file left in it after it was migrated to the pcb5iwyk.default-release profile

A simple way to fix this is to make it so that every directory in Profiles is parsed for bookmarks, or an alternate way is to parse C:\Users\USER\AppData\Roaming\Mozilla\Firefox\installs.ini and C:\Users\USER\AppData\Roaming\Mozilla\Firefox.profiles.ini to figure out what profiles to parse. installs.ini shows the "hash" of each install, and then you can look it up in profiles.ini by looking for [Install<HASHHERE>] entries

examples:

install.ini:

[308046B0AF4A39CB]
Default=Profiles/pcb5iwyk.default-release
Locked=1

[6F193CCC56814779]
Default=Profiles/ce7f2nr1.default-nightly
Locked=1

profiles.ini:

[Install308046B0AF4A39CB]
Default=Profiles/pcb5iwyk.default-release
Locked=1

[Profile2]
Name=default-nightly
IsRelative=1
Path=Profiles/ce7f2nr1.default-nightly

[Profile1]
Name=default
IsRelative=1
Path=Profiles/1jyccrk5.default
Default=1

[Profile0]
Name=default-release
IsRelative=1
Path=Profiles/pcb5iwyk.default-release

[Install6F193CCC56814779]
Default=Profiles/ce7f2nr1.default-nightly
Locked=1

[General]
StartWithLastProfile=1
Version=2

[BackgroundTasksProfiles]
MozillaBackgroundTask-6F193CCC56814779-backgroundupdate=rcfkzsfo.MozillaBackgroundTask-6F193CCC56814779-backgroundupdate
dkgv commented 2 years ago

Thanks for providing such a descriptive explanation 👍