views:

600

answers:

2

Hello all,

As a feature of the application I am creating - I wish to enable the importing of bookmarks from different browsers. I have two questions, the first is a bit silly:

  1. Is it possible to import bookmarks from the browser using JavaScript - I am guessing no?

  2. Does anyone know of any pre-written classes that I can make use of to allow me to import bookmarks from different browsers when a bookmark.html file is supplied by the user?

Pointing me in the right direction will also help or letting me know of a better implementation method.

I am using PHP and Javascript (JQuery). More specifically Codeigniter.

Thanks all

Update

As I thought question 1 is not possible.

What about 2? Anyone know of any php classes to parse bookmarks from different browsers?

+1  A: 

You need access to the file system to import the bookmarks, so no. Well you could if you used the Microsoft FileSystemObject, but that would only work for IE and the security settings of the browser would have to be modified. In FireFox/Mozilla you would be able to access the file system if you wrote a chrome application, i.e. add-on, but then all your users need to install your addon as well and that does not sound ideal for what you want to do.

Depending on your app maybe you could tap into a service like Del.icio.us or some other online bookmarking service to do what you want.

My two cents while waiting for the coffee to brew.

nickyt
Thanks nickyt - I will also be importing from delicious using their API - it was just the browser based bookmarks that I wanted to get done as easily and as efficiently as possible i.e. using other smarter developers classes - writing mine will work, but I'm sure it will have problems!
Abs
A: 

The short answer is no. it would be a huge violation of people's privacy to get access to their browser bookmarks.

You could request a user to upload their bookmarks file, which is just a HTML file that you can parse, but you would need instructions on how to do it for their browser, as well as specifically for their OS (it's different on XP vs Vista/Win7). Overall it's a usability nightmare but possible.

Firefox on XP stores it's bookmarks here (please note [] syntax is user specific placeholders)

C:\Documents and Settings\[USERNAME]\Application Data\Mozilla\Firefox\Profiles\[RANDOM_JUNK].default\bookmarks.html

but the same browser on Vista/Win7 would be at:

C:\users\[USERNAME]\Application Data\Mozilla\Firefox\Profiles\[RANDOM_JUNK].default\bookmarks.html
TravisO