Categories
Web Development

Cross-browser ‘Add Bookmark’ Link

It is not easy to invoke the ‘Add Bookmark’ dialog window of your browser from a link on the page. Well, it is very easy to achieve in Internet Explorer, but Firefox… an entirely different story.

Share

Internet Explorer appears to offer an easy way to add a bookmark to the current page. The code is as simple as

window.external.AddFavorite(url, title);

But Firefox and Mozilla-based browser are more finicky. Dynamic Drive have an idea on how to do that, using the JavaScript call

window.sidebar.addPanel(title, url, "")

which works, eh, sometimes
See, in my Firefox 1.0.7 the code above works just fine, but in my co-worker’s Firefox 1.0.7, it does not. Like Mozilla 1.5, his Firefox simply adds a panel to the browser sidebar (click ‘F9’ if you never met your sidebar), where the browser simply loads the page. Not what I wanted.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Share