Can I detect whether a browser's Bookmarks toolbar is enabled with JavaScript?

前端 未结 2 513
终归单人心
终归单人心 2021-01-21 10:07

I have a bookmarklet, and my users are consistently clicking it instead of dragging it to their bookmarks bar first. I\'d like to add an animation which would run in response t

相关标签:
2条回答
  • 2021-01-21 10:19

    For security reasons (among others), no - this is not possible with JavaScript.

    Even if a browser chose to make this information accessible to the client, it would not be a standard implementation (supported across multiple browsers).

    0 讨论(0)
  • 2021-01-21 10:32

    Put a div inside the link that holds a message when the user clicks on it use CSS to show the message. #bookmarklet:active #message{display:block;} You will need some javascript to return false on the click event.

    0 讨论(0)
提交回复
热议问题