jarun / buku

:bookmark: Personal mini-web in text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Autoimport from firefox with several installed editions

elig0n opened this issue · comments

I have both Firefox and Firefox Developer Edition installed on my machine.
~/.mozilla/firefox/profiles.ini lists two [Install*] sections with two different default profiles for each Firefox edition.
The current code in master branch only utilizes the first section in order, which in my case is not my desired profile.

Possible solutions:

  1. Allow to directly specify firefox profile full name/directory on the command line.
  2. Return an array of install_names with "default" keys in get_firefox_profile_name() and either use all of them one by one or ask the user to interactively choose one.
  3. Use [Profile*] sections only, skipping [Installs*] completely and default to selecting the last used profile (i.e. the one with Default=1)

Haven't tried the import feature before, but the issue turns out to be fully reproducible on my system (I have a Dev version of Firefox installed for – you've guessed it – development purposes, and that install is listed before the one I actually use for web-surfing).

That being said, the 3rd approach would fail on my system (the profile marked as default is empty for some reason).

Providing profile name via environment variable (e.g. FIREFOX_PROFILE="blahblah.default-release" buku --ai) is pretty trivial to implement, though the UX might be inconvenient…

The currently existing implementation already asks for user input (unless in library mode, I guess), so I tried implementing the 2nd one (offering to choose when multiple installs are detected, falling back to original behaviour in library mode); leaving the env var thing as a fallback.