Can you access a client's bookmarks using javascript with their permission?

一个人想着一个人 提交于 2019-12-30 14:47:16

问题


I want to make it easier for a user to import bookmarks to my server. Is there anyway to automate this process using javascript to obtain the user's bookmarks? I'm assuming the browser has to have this feature - and I'm not sure if any browser does due to the inherent security risk.


回答1:


Nope, that's not possible for security/privacy reasons. The only way is to ask them explicitly through form input to give you but I don't think you want to do that.




回答2:


The browser is obviously aware of their bookmarks, but no, JS cannot access this information - it would be leaking private data as you yourself have noted.

Anything you can do in JS with the user's permission can be done without their permission. The only manual control they have is "Run scripts" or "Don't".




回答3:


As yourself and others have noted, it's not possible because of privacy and security implications.

What you can do however is to import bookmarks from a source (XML, JSON, HTML...). Most browsers have an export bookmarks feature that generates a file. You can parse that to get what you want.




回答4:


What Sarfraz said, and thank God for it. I don't think users want people on the web to be able to access their bookmarks for any reason.




回答5:


im a 100 % sure there is no way to do this in js due to the securtity risk, however its probably possible with activex but thats only available on internet explorer



来源:https://stackoverflow.com/questions/3416161/can-you-access-a-clients-bookmarks-using-javascript-with-their-permission

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!