开发者

How to Import Bookmarks from Browsers (Firefox, Safari, Opera, Chrome) into your Application?

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?


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.


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜