MozillaZine

Bookmarks

From MozillaZine Knowledge Base

Bookmarks (also called Favorites in some browsers) let you save a link to a page in the browser interface so you can easily revisit pages without having to remember the url, or search for them again.

In Mozilla browsers like Firefox, Mozilla Suite and SeaMonkey, you can save bookmarks to, or view them from, the Bookmarks menu, the Bookmarks Toolbar or the Bookmarks Sidebar. You can organize or manage your bookmarks using the Bookmarks Manager (called the "Library" window in Firefox 3), accessible from the Bookmarks menu. You can also import another set of bookmarks or export your current bookmarks to a backup location, using the "Import" and "Export" features of the Firefox or Mozilla Suite/SeaMonkey/Firefox Bookmarks Manager.

Contents

Stored bookmarks and backups

In Mozilla Suite/SeaMonkey and and in Firefox 2 and below, bookmarks are stored in the file "bookmarks.html" located in the profile folder. (There is also a file called "bookmarks.html" in the program folder, but this one is a template, and does not hold your bookmarks.). In Firefox 2 and below, there is a file called "bookmarks.bak" (intended to protect against certain file system bugs [1]) and, by default, Firefox versions 1.5 and higher also create five daily backup files in the bookmarkbackups folder ("bookmarks-(date).html" in Firefox 1.5 and Firefox 2) . Mozilla Suite and SeaMonkey don't create automatic bookmark backups but you may find backups created by third party applications, for example, "bookmarks.html.sbsd.bak" or "bookmarks.html_deadlink_bak" [2] (also applies to Firefox).

Starting in Firefox 3, bookmarks, as well as browsing history, are stored in the Firefox profile folder in the places.sqlite file; in a converted profile, the bookmarks.html contents will be migrated to places.sqlite. Bookmark backups in Firefox 3 are stored in JSON format (e.g., "bookmarks-(date).json") and can be restored from within Firefox, using the Restore feature of the Bookmarks Manager. Firefox 3 no longer backs up your bookmarks in HTML format by default. [3] Note: You can set Firefox 3 to automatically export your bookmarks to "bookmarks.html" at exit, by setting browser.bookmarks.autoExportHTML to true.

You can use your operating system’s file and folder search feature to locate your stored bookmarks, or you can open the profile folder and look through its contents. To find all bookmarks files anywhere on your computer, search for bookmarks* (be sure to include the asterisk, with no space). Important: On Windows, you need to enable viewing and searching hidden files and folders. Read the information here for details, including a shortcut method for opening the profile folder.

Opening a bookmarks HTML file

When you locate a bookmarks file in HTML format such as bookmarks.html or any other bookmarks file ending in ".htm" or .html", you can double-click the file to open it with the program associated with HTML files, normally your default browser. When you open a bookmarks HTML file in the browser, the individual bookmarks will appear as a list of clickable links. You can also open a bookmarks HTML file from within Firefox or Mozilla Suite/SeaMonkey by clicking "File -> Open File" from the browser menu, then navigating to the folder that contains the bookmarks file and opening it.

For example, if you wish to review the contents of a dated bookmarks HTML file from a Firefox 2 bookmarkbackups folder, select "File -> Open File" from the Firefox menu. When the file picker appears, navigate to the Firefox profile folder's "bookmarkbackups" folder and select the "bookmarks-(date).html" file you wish to open. Windows 2000/XP/Vista users: You can easily open the Firefox bookmarkbackups folder by entering %APPDATA% for the file name and clicking "Open", then double-clicking each of these folders, as they appear: "Mozilla -> Firefox -> Profiles -> xxxxxxxx.default (where xxxxxxx is any sequence of numbers and characters) -> bookmarkbackups". You can then select one of the bookmarks-(date).html files and click "Open" to display the contents.

Opening a JSON backup

Starting in Firefox 3, bookmark backup files, including the files in the bookmarkbackups folder and any backups saved via the Library "Import and Backup -> Backup" feature, are stored in JSON format. If you open a JSON bookmark backup file in Firefox, the contents will be displayed as a line of text. If you want to view the contents as a page of clickable URLs, use "File -> Open File" in Firefox to browse to the JSON file (or drag a JSON file to an open Firefox window) and then run the following bookmarklet (create a new bookmark and enter the following code as the location): [4]

javascript:(function(){var E=document.getElementsByTagName('PRE')[0],T=E.innerHTML,i=0,r1,r2;t=new Array();while(/("uri":"([^"]*)")/g.exec(T)){r1=RegExp.$1;r2=RegExp.$2;if(/^https?:/.exec(r2)){t[i++]='['+(i)+']:<a href='+r2+'>'+r2+'<\/a>';}}with(window.open().document){for(i=0;t[i];i++)write(t[i]+'<br>');close();}})();

Saving a list of Firefox 3 bookmarks

Firefox 3 doesn't store your current bookmarks in HTML format but you can export your bookmarks to an HTML file and then open the bookmarks HTML file in any browser to view the contents as a clickable list of bookmarks, as explained above. You can also save a list of Firefox 3 bookmarks as follows: [5]

  1. Open the Library window ("Bookmarks -> Organize Bookmarks")
  2. In the left pane, context-click (right-click) on "All Bookmarks" and select "Copy".
  3. Paste into a word-processing document (e.g., Microsoft Word) or into an HTML editor (such as Nvu or KompoZer).

Sharing bookmarks

You can share the same bookmarks HTML file among different Firefox 2, Mozilla Suite or SeaMonkey profiles, by setting the preference browser.bookmarks.file to point to the file you wish to use.

You cannot share a Firefox 3 places.sqlite file. [6] but you can install the Foxmarks Bookmark Synchronizer extension to store your bookmarks on the Foxmarks site and access them from different profiles or locations. Alternately, you can install the Firefox Sync extension in Firefox 3.5 and above.

Setting bookmarks as the home page

In Mozilla Suite/SeaMonkey and Firefox 2 you can open the bookmarks.html file within your browser to display your bookmarks as a page of clickable links (see above). You can then set that page of bookmarks as the Home Page, either by dragging the Location Bar icon to the Home icon or by setting the current page as the Home Page in "Edit -> Preferences -> Navigator" (Mozilla Suite/SeaMonkey 1.x), "Edit -> Preferences -> Browser" (SeaMonkey 2) or "Tools -> Options -> Main / Startup" (Firefox).

Since Firefox 3 no longer saves your current bookmarks to "bookmarks.html" by default, you can set your home page to the following URL instead: [7]

  • chrome://browser/content/bookmarks/bookmarksPanel.xul

Copying portions of a bookmarks file

See this forum topic for a discussion about saving only a portion of your bookmarks, such as a subset of folders, to a new bookmarks file or profile.

See also

Category links at the bottom of MozillaZine articles provide links to additional related MozillaZine articles.

External links