Will Martin
Will Martin

Reputation: 4180

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

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 to a click on the bookmarklet, say "Drag me to your bookmarks bar!" and show a nifty arrow pointing at the bar.

But that only makes sense if the browser's bookmarks bar is actually visible. Can I detect whether the bookmarks bar is visible using JavaScript?

Upvotes: 3

Views: 3887

Answers (2)

qw3n
qw3n

Reputation: 6334

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.

Upvotes: 1

James Hill
James Hill

Reputation: 61793

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

Upvotes: 2

Related Questions