Search code examples
javascriptfirefoxgreasemonkeybookmarks

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


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?


Solution

  • 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.