-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use default profile #6
Comments
Michael Heerdegen <[email protected]> writes:
Hi,
when I upgrade firefox versions in Debian and restart the browser,
firefox edits the file "~/.mozilla/firefox/profiles.ini" and often
adds new profiles. It doesn't change the default profile but it always
happens that the default profile is not listed as first in the file
any more.
Hmm, not sure where looking, for me it is working fine because it
seems all profiles have same path.
But helm-firefox just uses the name of the first profile listed in the
files to get the bookmarks. So, after upgrading firefox I always have
to edit profiles.ini manually and move the profiles around so that the
default profile comes first. Can helm-firefox be smarter and search
for the default profile by itself?
So, what is the default profile, the one with "Name=Default"?
I have also an option in the General section with
"StartWithLastProfile=1", do you have the same option enabled?
…--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
|
Thierry Volpiatto <[email protected]> writes:
Hmm, not sure where looking, for me it is working fine because it
seems all profiles have same path.
Do you mean the "Path=..." specs? They are different for me for every
profile.
So, what is the default profile, the one with "Name=Default"?
I guess. At least it's the one with "my" bookmarks.
Since some weeks the file also includes sections like
[Install4F96D1932A9F858E]
Default=zb8lgbe2.default-release
Locked=1
I'm not sure what the resulting semantics are, and whether the syntax
even differs on different platforms.
I have also an option in the General section with
"StartWithLastProfile=1", do you have the same option enabled?
Yes, I have that.
Michael.
|
Michael Heerdegen <[email protected]> writes:
Thierry Volpiatto ***@***.***> writes:
> Hmm, not sure where looking, for me it is working fine because it
> seems all profiles have same path.
Hmm, not for me:
[Install4F96D1932A9F858E]
Default=onguag7n.default-release
Locked=1
[Profile1]
Name=default
IsRelative=1
Path=onguag7n.default-release
Default=1
[Profile0]
Name=default-release
IsRelative=1
Path=onguag7n.default-release
[General]
StartWithLastProfile=1
Version=2
Do you mean the "Path=..." specs? They are different for me for every
profile.
> So, what is the default profile, the one with "Name=Default"?
I guess. At least it's the one with "my" bookmarks.
Since some weeks the file also includes sections like
[Install4F96D1932A9F858E]
Default=zb8lgbe2.default-release
Locked=1
Yes same, see above, so perhaps we have now to search "Default" instead
of path (perhaps fallback to "Path" if "Default" is not a valid
directory name?) WDYT?
I'm not sure what the resulting semantics are, and whether the syntax
even differs on different platforms.
Me the same, but I don't think it differs on different platforms but
with different versions yes (older).
…--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
|
Thierry Volpiatto <[email protected]> writes:
Yes same, see above, so perhaps we have now to search "Default" instead
of path (perhaps fallback to "Path" if "Default" is not a valid
directory name?) WDYT?
First, some background I found:
https://support.mozilla.org/en-US/questions/1276002
https://support.mozilla.org/en-US/kb/understanding-depth-profile-installation
A problem I see with the new syntax: if a user has different defaults
for different firefox installations (which seem to be identified with a
hash), how do we find which one we should choose?
Anyway, I seem to currently have three profiles and three according
profile paths in my setup, and only one includes a bookmarks.html. I
guess this is true for most of the users. Maybe we should just look for
files named "bookmarks.html" in "~/.mozilla/firefox/*" and choose the
one most recently changed if there is more than one? We could also add
a user option that allows to choose between that behavior and specifying
a path directly. If no bookmark file has been found there should be
some kind of notification (error).
Michael.
|
Michael Heerdegen <[email protected]> writes:
Thierry Volpiatto ***@***.***> writes:
> Yes same, see above, so perhaps we have now to search "Default" instead
> of path (perhaps fallback to "Path" if "Default" is not a valid
> directory name?) WDYT?
First, some background I found:
https://support.mozilla.org/en-US/questions/1276002
https://support.mozilla.org/en-US/kb/understanding-depth-profile-installation
Thanks for the links.
A problem I see with the new syntax: if a user has different defaults
for different firefox installations (which seem to be identified with a
hash), how do we find which one we should choose?
After reading documentation, it seems different profiles are used for
people using different versions of firefox on same machine.
The last installed create a new directory without all your options,
bookmarks etc...
IIRC, it happened to me to have different directories in the
~/.mozilla/firefox directory because I had the (bad) habit of restoring
my previous .mozilla directory through OS reinstallations (new versions,
changing laptop etc...), I am now using firefox sync and I have no more
problem, it seems to be the recommended way with also letting firefox
choose the directory of the last installed to avoid corruption.
It seems also that if you reuse a old .mozilla directory a new directory
is created at each firefox upgrade in .mozilla/firefox.
Anyway, I seem to currently have three profiles and three according
profile paths in my setup, and only one includes a bookmarks.html.
I guess you are in the same case than me when I was reusing my old
.mozilla unless you are using simultaneously different firefox versions
e.g. stable and nighly.
I guess this is true for most of the users. Maybe we should just look
for files named "bookmarks.html" in "~/.mozilla/firefox/*" and choose
the one most recently changed if there is more than one?
In the case of people using only one version of firefox yes, but for
others using different versions this will be wrong because you will have
your old bookmarks yes, but all the new ones will be saved in another
directory and you will never see them in helm-firefox.
We could also add a user option that allows to choose between that
behavior and specifying a path directly. If no bookmark file has been
found there should be some kind of notification (error).
Yes, perhaps this is the best option, using what we have actually as
default, but to ensure you never have problems, the best is perhaps to
avoid the error described above and use firefox sync.
…--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
|
thierryvolpiatto
pushed a commit
that referenced
this issue
Mar 5, 2020
if needed (#6). * helm-firefox.el (helm-firefox-bookmark-user-directory): New. (helm-guess-firefox-bookmark-file): Use it.
I have added a new user var `helm-firefox-bookmark-user-directory` which
default to what we were using previously.
…--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
|
Thierry Volpiatto <[email protected]> writes:
I guess you are in the same case than me when I was reusing my old
.mozilla unless you are using simultaneously different firefox versions
e.g. stable and nighly.
Something like this, indeed. Ebay didn't work with stable firefox, so I
had installed several versions at the same time.
> I guess this is true for most of the users. Maybe we should just look
> for files named "bookmarks.html" in "~/.mozilla/firefox/*" and choose
> the one most recently changed if there is more than one?
In the case of people using only one version of firefox yes, but for
others using different versions this will be wrong because you will have
your old bookmarks yes, but all the new ones will be saved in another
directory and you will never see them in helm-firefox.
Not sure if you understood what I meant: the most recently changed file
named "bookmarks.html" in the "~/.mozilla/firefox/*" dir tree will
contain the new bookmarks, right? I hoped that with this method, we
will always get the bookmarks corresponding to the last active firefox
session, which seems quite natural.
|
Does this function returns the right directory for you? (defun helm-get-firefox-user-init-dir ()
"Guess the default Firefox user directory name."
(with-current-buffer
(find-file-noselect
(expand-file-name "profiles.ini" helm-firefox-default-directory))
(goto-char (point-min))
(prog1
(cl-loop with dir
with atime = 0
while (re-search-forward "Path=" nil t)
for tmpdir = (buffer-substring-no-properties (point) (point-at-eol))
for bmkfile = (expand-file-name "bookmarks.html" tmpdir)
for at = (if (file-exists-p bmkfile)
(float-time (nth 5 (file-attributes bmkfile)))
(max atime 0))
when (> at atime)
do (setq dir tmpdir
atime at)
finally return (file-name-as-directory
(expand-file-name dir)))
(kill-buffer)))) |
Thierry Volpiatto <[email protected]> writes:
Does this function returns the right directory for you?
Yes, it does, looks good, thanks (caveat: instead of high level
`find-file-noselect` I suggest to use `with-temp-buffer` +
`insert-file-contents'.)
Michael.
|
thierryvolpiatto
pushed a commit
that referenced
this issue
Mar 6, 2020
its directory (#6). * helm-firefox.el (helm-get-firefox-user-init-dir): Do it.
Michael Heerdegen <[email protected]> writes:
Thierry Volpiatto ***@***.***> writes:
> Does this function returns the right directory for you?
Yes, it does, looks good, thanks (caveat: instead of high level
`find-file-noselect` I suggest to use `with-temp-buffer` +
`insert-file-contents'.)
Yes indeed, now installed thanks.
…--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
|
Thierry Volpiatto <[email protected]> writes:
Yes indeed, now installed thanks.
Great, thanks. I haven't yet tested your change, but will do when it
has arrived on Melpa. If it works ok for you feel free to close.
Thanks, Michael.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
when I upgrade firefox versions in Debian and restart the browser, firefox edits the file "~/.mozilla/firefox/profiles.ini" and often adds new profiles. It doesn't change the default profile but it always happens that the default profile is not listed as first in the file any more. But helm-firefox just uses the name of the first profile listed in the files to get the bookmarks. So, after upgrading firefox I always have to edit profiles.ini manually and move the profiles around so that the default profile comes first. Can helm-firefox be smarter and search for the default profile by itself?
TIA, Michael.
The text was updated successfully, but these errors were encountered: