-
-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autoimport fails to find Firefox profiles & issue with hardcoded profiles path when IsRelative=0 #791
Comments
Sorry, we can't keep adding support for custom paths for each browser. |
@jarun I think handling absolute paths in When used with the sample file provided by OP, that function produces the following output: ['/path/to/custom/path/my-main-profile', '1koqf71l.default-nightly'] |
Isn't the correct filename
|
@LeXofLeviafan We support more than firefox. We would need such provisions for every browser we support. |
@jarun other browsers use static paths; only Firefox relies on an additional config file to determine profile location (at least out of those supported). |
OK. In that case please raise a PR. |
I hadn't thought of that and could live with it.
Yes, I've just edited my first post.
Indeed, I've just edited my first post with
So should we have something like
Note that it would extend buku autoimport feature support to most non-Mozilla Firefox-based browsers (Waterfox, Floorp, Librewolf, etc.) which use the same profile system, but whose default paths obviously do not start with |
No, just pass full path to the directory in |
Great, if it helps, I have come with the following helper (yet untested!) to manage FIREFOX_PROFILE in each of those cases:
def get_firefox_bm_db_paths(firefox_profile, default_ff_folder):
"""List Firefox bookmarks database paths
Returns
-------
ff_bm_db_paths : {str}
Firefox bookmarks database paths for all profiles (either default or related to existing FIREFOX_PROFILE environment variable).
"""
import os
ff_bm_db_paths = {}
if firefox_profile and os.path.isabs(firefox_profile[0]) and os.path.isfile( os.path.join(firefox_profile[0], 'profiles.ini') ): # Custom profiles directory
ff_folder = firefox_profile[0].strip('/')
profiles = get_firefox_profile_names(ff_folder)
elif firefox_profile and os.path.isabs(firefox_profile[0]): # Custom profile path
ff_folder, profiles = os.path.split( firefox_profile[0].strip('/') )
profiles = [profiles]
else: # Default profiles directory
ff_folder = default_ff_folder
profiles = firefox_profile or get_firefox_profile_names(default_ff_folder)
if profiles:
ff_bm_db_paths = {s: ff_folder + '/{}/places.sqlite'.format(s)
for s in profiles}
return ff_bm_db_paths The idea would be to use it by replacing current portion of the code:
with: default_ff_folder = os.path.expanduser('~/.mozilla/firefox')
ff_bm_db_paths = get_firefox_bm_db_paths(firefox_profile, default_ff_folder) ...3 times due to |
…That's a bit too complicated of a logic. If you need to specify a custom path anyway, you might as well just specify the path to the profile you want to be imported. Though your idea is pretty similar to what I did. (…I actually implemented the fix on that same day, but I ended up postponing the commit till now due to lack of time to work on tests n'stuff 😅) |
Yep, thanks for addressing the issue! |
[#791] added support for absolute paths in Firefox autoimport
Hello,
Profiles.ini content
buku --ai
shows the following (i.e. bookmarks from an empty default profile) despite~/.mozilla/firefox/profiles.ini
contains multiple profiles (cf. above):As for trying it with
FIREFOX_PROFILE
env variable:I understand it can't work since that profile is at a custom path (
/path/to/custom/path/my-main-profile
) whereas the default path is harcoded in buku's code:buku/buku
Line 2879 in 48bf29e
Maybe we could have
FIREFOX_PROFILE_PATH
instead?The text was updated successfully, but these errors were encountered: