Mozilla Firefox: Automatically save bookmarks to an HTML file

I recently found out about an interesting feature of Mozilla Firefox, that is not new, but of which haven’t heard before: Firefox can be configured to automatically save its bookmarks as an HTML file to a specific folder on exit.

Although I know (and make use of) the capability to save the bookmarks explictly from the library 1), and I also dimly remember having read about the fact that Firefox backs up the most recent bookmark files 2, I didn’t know about this ‘auto save’ gimmick.

Here’s how to set it up:

  1. Enable the feature: Type about:config in the address bar and press Enter (select “Accept the Risk and Continue”).
  2. Enter browser.bookmarks.autoExportHTML in the search bar at the top.
  3. Toggle the value to True by clicking the button at the right.
  4. Create a new configuration preference: Enter browser.bookmarks.file in the search bar at the top.
  5. Select String and click the Add/[+] button at the right.
  6. Enter the full path of the location where you want to save the file, e.g. C:\Users\<username>\Documents\Bookmarks Backup\Bookmarks.html (plain text, no need for enclosing quotes, even with spaces in the path).
  7. Click the Save/Checkmark button and close the configuration tab again.
  8. Firefox needs to be restarted for the changes to take effect.
    After that, your file will be saved there everytime you close Firefox.
    Note that only one file is created and is being overwritten each time that you close the browser!

  1. Either backup/restore a JSON file or export/import an HTML file. ↩︎

  2. Firefox automatically creates backups of your last 15 bookmark files for safekeeping; they are located in your Firefox User Profile.
    On Windows 10, that would be for example C:\Users\<USERNAME>\AppData\Roaming\Mozilla\Firefox\Profiles\<PROFILE-ID>\bookmarkbackups\. ↩︎