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

编程入门 行业动态 更新时间:2024-10-26 08:24:11
本文介绍了如何检测用户书签中是否已存在链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是否可以从Greasemonkey脚本确定书签中是否已存在链接? 例如如果我要标记页面上所有带有书签的链接.

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?

推荐答案

Greasemonkey脚本无法确定浏览器/用户书签中是否存在链接,原因是:

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

  • 出于安全原因,普通javascript不允许知道此信息.

    Greasemonkey不提供此功能,并且 Greasemonkey的控制开发人员始终拒绝添加类似的功能功能.

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

    另请参见如何检测页面上已访问和未访问的链接?" .

    Firefox附加组件可以尽管这样做.因此,如果您感到烦躁,可以分叉Greasemonkey并添加此功能,也可以编写一个可以向您的脚本发送消息的辅助程序插件.

    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.

  • 更多推荐

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

    本文发布于:2023-10-24 17:28:59,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1524559.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:书签   链接   用户

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!