How to detect if a link already is in the user's bookmarks?

*爱你&永不变心* 提交于 2020-01-03 00:22:14

问题


Is it possible to determine from a Greasemonkey script if a link is already in the bookmarks or not? E. g. if I want to mark all links on the page which are bookmarked.

Also, how can I find the name of the folder where this bookmark is stored?


回答1:


A Greasemonkey script cannot tell if a link is in the browser's/user's bookmarks because:

  1. Ordinary javascript is not allowed to know this for security reasons.

  2. Greasemonkey does not provide this capability and Greasemonkey's controlling developers have consistently refused to add similar capabilities.

See, also, "How can I detect visited and unvisited links on a page?".


Firefox add-ons can do this though. So, if you were feeling frisky, you could either fork Greasemonkey and add this capability or you could write a helper add-on that could message your script.



来源:https://stackoverflow.com/questions/25704556/how-to-detect-if-a-link-already-is-in-the-users-bookmarks

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