Поиск в Поддержке

Избегайте мошенников, выдающих себя за службу поддержки. Мы никогда не попросим вас позвонить, отправить текстовое сообщение или поделиться личной информацией. Сообщайте о подозрительной активности, используя функцию «Пожаловаться».

Learn More

Export all the bookmarks from a loads of profiles from a script

  • 3 ответа
  • 1 имеет эту проблему
  • 620 просмотров
  • Последний ответ от estebann

more options

Hello everyone :)

From a folder, I have loads of Firefox profiles from different eras. I am looking for a way to export all the bookmarks of each of the profiles to an HTML file like the manual method (Library > Import and backup > Export bookmarks to formal HTML), but all in an automatic way by script. I like the HTML export from Firefox because it allows you to quickly navigate using keywords, either in links or in the folder names I gave.

Is there a simple solution that would reuse, for example, the same export code as Firefox ?

Thanks in advance With adelphity estebann

Hello everyone :) From a folder, I have loads of Firefox profiles from different eras. I am looking for a way to export all the bookmarks of each of the profiles to an HTML file like the manual method (Library > Import and backup > Export bookmarks to formal HTML), but all in an automatic way by script. I like the HTML export from Firefox because it allows you to quickly navigate using keywords, either in links or in the folder names I gave. Is there a simple solution that would reuse, for example, the same export code as Firefox ? Thanks in advance With adelphity estebann

Выбранное решение

As an easier workaround you can possibly enable autoExportHTML by setting to make Firefox create an HTML bookmarks backup each time you close Firefox.

  • browser.bookmarks.autoExportHTML = true in the profile.

You can do this via an autoconfig.cfg file for all profiles.

// autoconfig.cfg needs to start with a blank line
pref("*browser.bookmarks.autoExportHTML", true);

That way you only need to start Firefox with using each profile.

Otherwise you would have to figure out how to create an HTML backup from places.sqlite.

The HTML backup is created by default in the profile folder as bookmarks.html every time you close Firefox, but you can set the path and file name via the browser.bookmarks.file pref on the about:config page. The browser.bookmarks.file pref doesn't exist by default and you need to create a new String pref with the name browser.bookmarks.file and set the value to the full path of the backup bookmarks.html file including the file name.

Прочитайте этот ответ в контексте 👍 1

Все ответы (3)

more options

What you could do is load each profile one at a time. Then do this;

Open the Bookmarks Manager; Press the Alt or F10 key to bring up the toolbar, and select Bookmarks. Hot key is <Control> (Mac=<Command>) <Shift> B. Firefox 84+ <Control> (Mac=<Command>) <Shift> O.

Once the window is open, at the top of the page, press the button labeled Import and Backup. Select Export Bookmarks To HTML, and follow the prompts and save it to a HTML file.

more options

Выбранное решение

As an easier workaround you can possibly enable autoExportHTML by setting to make Firefox create an HTML bookmarks backup each time you close Firefox.

  • browser.bookmarks.autoExportHTML = true in the profile.

You can do this via an autoconfig.cfg file for all profiles.

// autoconfig.cfg needs to start with a blank line
pref("*browser.bookmarks.autoExportHTML", true);

That way you only need to start Firefox with using each profile.

Otherwise you would have to figure out how to create an HTML backup from places.sqlite.

The HTML backup is created by default in the profile folder as bookmarks.html every time you close Firefox, but you can set the path and file name via the browser.bookmarks.file pref on the about:config page. The browser.bookmarks.file pref doesn't exist by default and you need to create a new String pref with the name browser.bookmarks.file and set the value to the full path of the backup bookmarks.html file including the file name.

more options

FredMcD said

What you could do is load each profile one at a time. Then do this; Open the Bookmarks Manager; Press the Alt or F10 key to bring up the toolbar, and select Bookmarks. Hot key is <Control> (Mac=<Command>) <Shift> B. Firefox 84+ <Control> (Mac=<Command>) <Shift> O. Once the window is open, at the top of the page, press the button labeled Import and Backup. Select Export Bookmarks To HTML, and follow the prompts and save it to a HTML file.

Thank you for this idea but this is not really what I want to do (we will say that will be the last alternative).

cor-el said

As an easier workaround you can possibly enable autoExportHTML by setting to make Firefox create an HTML bookmarks backup each time you close Firefox.
  • browser.bookmarks.autoExportHTML = true in the profile.
You can do this via an autoconfig.cfg file for all profiles.
// autoconfig.cfg needs to start with a blank line
pref("*browser.bookmarks.autoExportHTML", true);

That way you only need to start Firefox with using each profile.

Good idea ! It will be semi-automated as I will just have to close each instance !

cor-el said

Otherwise you would have to figure out how to create an HTML backup from places.sqlite.

Great ! Thank you for pointing this code page :) ... Before posting, I had tried to use SQLite databases, but without knowing too much about the databases used, nor the relationships between the data. I think this code analysis will make it clearer.

If I get the desired result, when I have put it in place I will come back to detail my solution but I don't know when. I think that in straight lines it should not be too complicated.

Anyway, thank you and problem solved ;D !

Изменено estebann