如何检测链接是否已存在于用户的书签中?

时间:2014-09-06 20:42:24

标签: javascript firefox greasemonkey bookmarks

是否可以从Greasemonkey脚本中确定书签中是否已有链接? E. g。如果我想在页面上标记所有已添加书签的链接。

另外,如何找到存储此书签的文件夹的名称?

1 个答案:

答案 0 :(得分:1)

Greasemonkey脚本无法判断链接是否在浏览器/用户的书签中,因为:

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

  2. Greasemonkey不提供此功能,Greasemonkey's controlling developers have consistently refused to add similar capabilities

  3. 另见"How can I detect visited and unvisited links on a page?"


    Firefox add-ons can do this though。所以,如果你感觉很活泼,你可以分叉Greasemonkey并添加这个功能,或者你可以编写一个可以给你的脚本发消息的辅助加载项。