-
Notifications
You must be signed in to change notification settings - Fork 10
Netscape Bookmarks File Format
The Netscape Bookmarks File Format is used by browsers to export bookamrks as html. Some info about the format here
The file start with the following text:
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!--This is an automatically generated file.
It will be read and overwritten.
Do Not Edit! -->
<Title>Bookmarks</Title>
<H1>Bookmarks</H1>
However some browser put in the H1
tag a different text, like the translation of
"Bookmarks" to the language of the browser
<DL><p>
{item}
{item}
{item}
.
.
.
</DL><p>
Even that I couldn't find an example outside of Microsoft's Documentation, some files
may have just DL
tags, without the p
tag.
An item may be a subfolder, shortcut, feed, Web Slice, or icon.
If {item} refers to a subfolder, it is:
<DT><H3 ADD_DATE="{date}">{title}</H3>
<DL><p>
{item}
{item}
{item}
.
.
.
</DL><p>
Some files may have FOLDED
after the <H3
, but before ADD_DATE
, like an attribute, but
without a value. Internet Explorer html exports have it. Most common browsers will add
more attributes to the H3
tag, like LAST_MODIFIED={date}
and PERSONAL_TOOLBAR_FOLDER="true"
, if
the folder is the bookmark toolbar:
<DT><H3 ADD_DATE="{date}" LAST_MODIFIED="{date}">{title}</H3>
<DT><H3 ADD_DATE="{date}" LAST_MODIFIED="{date}" PERSONAL_TOOLBAR_FOLDER="true">{title}</H3>
If {item} refers to a shortcut, it is:
<DT><A HREF="{url}" ADD_DATE="{date}" LAST_VISIT="{date}" LAST_MODIFIED="{date}">{title}</A>
However, a shortcut tag probably will have more attributes, the most common exported by browsers are:
Chrome
<DT><A HREF="{url}" ADD_DATE="{date}" LAST_MODIFIED="{date}" ICON={icon}>{title}</A>
Firefox
<DT><A HREF="{url}" ADD_DATE="{date}" LAST_MODIFIED="{date}" ICON_URI= "{icon_uri} "ICON={icon}>{title}</A>
{icon_uri}
is an url to a favicon URI, normally stored in {domain}/favicon.ico
of
the shortcut url. For sites that doesn't have this file, fake-favicon-uri:{url}
is
in place of it, being {url} the same of HREF
Other attributes that are not common: PRIVATE="1"
(possibily private shortcut),
TAGS=['{tag}, {tag}, ...]
(some browser have tag list for bookmarks, however some
of these doesn't export them),SHORTCUTURL="{shortcut}"
(address bar shortcut
keyword, used by Firefox, see #8)
There may be, after the shortcut tag, a DD
tag with a comment:
<DD>{comment}
{date}
is a decimal integer that represents the number of seconds elapsed since
midnight January 1, 1970 ("unix time").
{icon}
is an image, commonly a png, encoded in base64 (there may be other, but
I've never seen one). It can be a big string of characters, responsible for a big part
of the shortcut tag
If {item} refers to a feed, it is:
FEED="true"
FEEDURL="href... "
If {item} refers to a Web Slice, it is:
WEBSLICE="true"
ISLIVEPREVIEW="true"
PREVIEWSIZE="w x h"
If {item} refers to an icon, it is:
{item}
ICON_URI="href... "
Note: These last there were never found by me. It's copied and pasted from Microsoft's Documentation
Example with DD tag and PRIVATE and TAGS attribute (at the end of the article),
Example with H1 tag with translated,
Example with DD tag and PRIVATE and TAGS attribute,
Bookmarks html exportation files with Opera, Firefox, Chrome, Internet Explorer 11 and new Edge (this last one is in test\test.html of this repository)