如何将书签从浏览器(Firefox、Safari、Opera、Chrome)导入到您的应用程序中?
作为我正在创建的应用程序的一个功能 - 我希望能够从不同的浏览器导入书签。我有两个问题,第一个问题有点傻:
是否可以使用 JavaScript 从浏览器导入书签 - 我猜不行?
有谁知道我可以使用任何预先编写的类来允许我在用户提供 bookmark.html 文件时从不同的浏览器导入书签吗?
为我指明正确的方向也将有助于或让我知道更好的实施方法。
我正在使用 PHP 和 Javascript (JQuery)。更具体地说 代码点火器。
谢谢大家
更新,
因为我认为问题 1 是不可能的。
2个呢?有人知道任何 php 类可以解析来自不同浏览器的书签吗?
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:
Is it possible to import bookmarks from the browser using JavaScript - I am guessing no?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要访问文件系统才能导入书签,所以不需要。好吧,如果您使用 Microsoft FileSystemObject ,但这仅适用于 IE,并且必须修改浏览器的安全设置。在 FireFox/Mozilla 中,如果您编写了 chrome 应用程序(即插件),您将能够访问文件系统,但随后所有用户都需要安装您的插件,这听起来并不适合您想要做的事情。
根据您的应用程序,您可能可以利用 Del.icio.us 等服务或其他在线书签服务来执行您想要的操作。
在等待咖啡冲泡时我的两分钱。
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.
简短的回答是否定的。访问他们的浏览器书签将严重侵犯人们的隐私。
您可以请求用户上传他们的书签文件,该文件只是一个您可以解析的 HTML 文件,但是您需要有关如何针对他们的浏览器以及专门针对他们的操作系统执行此操作的说明(XP 与 Vista 上的情况不同) /Win7)。总的来说,这是一个可用性噩梦,但也是可能的。
XP 上的 Firefox 将其书签存储在此处(请注意 [] 语法是用户特定的占位符),
但 Vista/Win7 上的同一浏览器将位于:
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)
but the same browser on Vista/Win7 would be at: