Problems accessing FireFox Bookmarks User Data and a method for processing exported bookmark data for use in web pages or other external formats

By Craig Webb

This blog entry describes a series of experiments that I recently conducted. My objective is to export my FireFox bookmarks, clean up the HTML bookmarks file, and format it into a usable, straightforward XML format that looks like this:


Website URL
This is what this website is about
My XML Bookmark format

My XML Bookmark format

 

Exporting clean, usable bookmarks from FireFox turns out to be difficult. The exported HTML code is loaded with lots of extra tagged-code that is hard to remove and slows or stalls the program. Choking the file is tons of unwanted ICO junk; line upon line of MIME-formatted code that makes it nearly unreadable and impossible simply to open.

I believe that including ICO MIME code in a bookmark export is nothing less than sabotage by FireFox. Why would anyone want this code? I challenge software developers to develop software so that users HAVE UNFETTERED ACCESS TO THEIR DATA.

My Method:

To start, I have exported my FireFox bookmarks into HTML format. I open my HTML FireFox bookmarks file and examine the source code, which declares itself to be a !DOCTYPE NETSCAPE-Bookmark-file-1 file. It also says:

< ! This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->

I edit. I add a piece of JavaScript code that was provided by a Mozilla Expert, Edward N Heinrich, in a Mozilla forum. The JavaScript code is intended to strip out the ICO Icon Attribute code that FireFox exports along with the bookmark URLs.

Heinrich* did not explain how to use the JavaScript. He never replied to further queries, so I’m not sure that I am properly applying this code, however I do get the desired result.

Here is Heinrich’s JavaScript code. I added JavaScript language tags at top and bottom:

javascript: (function(){ var ls=document.getElementsByTagName('*'), lsl=ls.length; for (var i=0; i=0;i--) e[i].parentNode.removeChild(e[i]); alert('Cleanup Complete - Save as Web Page, Complete\n'+'('+lsl+' bookmarks, '+el+' descriptions)')})();

After pasting in the code, I opened the bookmark HTML file using my Safari browser. The JavaScript program is executed and it hides the icon code and various other attributes, but the program does not strip them out. A look at the source code reveals that the icon MIME junk is still lurking there.

I tried saving the open HTML file as a new HTML document but upon opening the new file I found that it is still polluted with MIME icon code.

My next experiment was to copy the HTML text from the Safari browser window and paste it into a TextEdit file in RTF and HTML UTF-8 format. I saved one copy as an HTML file and another as a RTF file. Only the HTML version re-opened in Safari. The RTF experiment failed.

The TextEdit HTML file successfully opened in Safari. I examined the source code to find that the odious icon code from FireFox had been successfully eliminated (yay!), however, Safari/ TextEdit had imposed its own weirdly redundant Apple combination of CSS styled-code and old-fangled HTML-2 code on each line of the bookmark list. The Apple TextEdit HTML code looks like this:


The CSS style is:

p.p4 {margin: 0.0px 0.0px 0.0px 0.0px}
font.f2 {font: 16.0px Times; color: #0000eb}

So my file is still choking with excess code, but it is way-tons better than the FireFox export. The next steps of this experiment are clear. I copy/save the browser source-code into a TextEdit file and proceed to strip out the Apple/Safari code, replacing it with my XML tags.

It is ironic that in order to get my bookmark code out of FireFox in a usable format, my recourse is to use Apple technology. To me, poor software design is epitomized by a need to use third-party software to manage tasks and access user data.

Getting the MIME code out of an exported FireFox bookmark file without the automation of the JavaScript file provided by Edward N Heinrich would be an impossible chore. The JavaScript described in this article provides a way to mechanically remove large sections of tagged code. Utilizing various Apple software functions continues the code-cleaning process, and the final objective may be accomplished with Find/Replace.

Now I am free to quickly copy-paste Folders and URL data to organize it within my HTML file.

If anyone knows a simpler way to get clean bookmarks out of FireFox, please let me know.

* * * * * *

Here are some additional FireFox software interface problems with bookmarks that I consider as design-feature flaws in need of correction or improvement.

When I first started saving bookmarks in FireFox many years ago, each bookmark was saved separately. I spent lots of time moving the bookmarks into folders, using the FireFox Bookmarks Organizer. The FireFox Bookmark Organizer interface is painfully slow and tedious; another reason why I want to get my bookmarks out of the software.

Recently, FireFox offered an innovation – the ability to open multiple webpage windows in the browser by using tabs, along with the ability to save all of the opened tabs into a bookmark folder. [At this writing, Safari cannot save multiple tabs]

Utilizing the ability to open multiple web pages into tabs, I developed the habit of searching for a subject, opening multiple websites, and saving all of them in a folder named for the subject. I will save 30+ pages on any given subject into one folder. Alternatively, I will conduct tasks such as a job search and save an entire day’s search drek into a dated Job-Search folder.

Now I have zillions of these folders. Unfortunately, I find that when multiple web pages are saved in a folder by using tabs, the individual URLs are saved *with no individual descriptions*. It will now be necessary to revisit each individual website, get a description of what it is, and manually type a description into my exported data. This sucks.

In the best of all possible worlds, I would have the option to choose what data is stored and exported in my easy-to-copy and read preferences file. For example I would choose: website URL – YES; Page Descriptions – YES; ICO Icon in MIME format – NO; Time-stamp – NO.

At the time of Export, I would also like to be able to re-select what information I want to export – some or all of it.

Since I have used the tabbed-folder option and I have lost the website descriptions, I would also like to define the order in which data is exported. I would like to invert the order of the Website name and the URL.

FireFox prompts the user to save tags along with web page bookmarks, but there is no way to export the tags along with the URLs, website name and descriptions. The columns of the Bookmark Organizer can be reordered by dragging them, but the organization of the exported data is not controlled or affected by changing the column order.

It would be great if the user’s work adding tags could be accessed and exported along with the user’s URLs and other data that they describe. It also would be great if the Bookmark Organizer user interface acted as a tool to modify and format export data.

In Conclusion, This article explored how to clean out unwanted code from HTML files exported from the FireFox Bookmark Organizer management tool. Obtaining clean HTML exports of bookmark URLs should be a simple task in FireFox, but other software programs have equal barriers to overcome.

I aspire to a design standard that users should have unfettered access to all of their data. No browser currently holds this standard, so it is important to let software developers know what we expect and need. Let me know if this article is helpful to you.

© 062109 Craig Webb. All rights reserved.

Posted under Uncategorized

This post was written by cwebba on June 30, 2009

Tags: , , , ,