nicolas-graves / ibrowse.el

Interact with your browser from Emacs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Firefox profile issue

walseb opened this issue · comments

Hello!

Thanks so much for this package!

In this function:

(defun ibrowse-core-get-firefox-dir ()
  "Try to get the Firefox data directory."
  (let* ((firefox-dirlist
          (append
           (file-expand-wildcards "~/.mozilla/firefox/*.default")
           (file-expand-wildcards
            (expand-file-name "Mozilla/Firefox/Profiles/*"
                              (getenv "APPDATA"))))))
    (when firefox-dirlist
      (concat
       (expand-file-name
        (car (seq-sort #'file-newer-than-file-p firefox-dirlist))
        (getenv "HOME"))
       "/"))))

It searches for Firefox profiles named *.default in ~/.mozilla/firefox/, however, when I install Firefox using nix-home-manager, it puts the profiles in that folder without any .default postfix. It just creates folders using the name of the profile.

This causes ibrowse.el to think I don't have Firefox installed.

Changing the function to the following fixes the problem, and selects the default profile, which is an issue if you have many profiles, but I only care about the default profile for now:

(defun ibrowse-core-get-firefox-dir ()
  "Try to get the Firefox data directory."
  (let* ((firefox-dirlist
          (append
           (file-expand-wildcards "~/.mozilla/firefox/default") ;; Only line changed
           (file-expand-wildcards
            (expand-file-name "Mozilla/Firefox/Profiles/*"
                              (getenv "APPDATA"))))))
    (when firefox-dirlist
      (concat
       (expand-file-name
        (car (seq-sort #'file-newer-than-file-p firefox-dirlist))
        (getenv "HOME"))
       "/"))))

I thought I would just report this issue in case anyone else runs into it. Ideally, ibrowse.el would be able to select which browser profile to pick from inside ~/.mozilla/firefox/ I think.

Would that work on your side with (file-expand-wildcards "~/.mozilla/firefox/*default") ?

If yes, that would probably work in both cases, so that should be a quickfix.

This should work, I'm going to make this quickfix.

Hi! I tried (file-expand-wildcards "~/.mozilla/firefox/*default") just now, and it works. Thanks!