Set as Homepage, Bookmark a page

The following javascript code snippet allows a user to add your page as homepage, and to bookmark (favorite) your page.

The following javascript function code allows you to add the current address location as the Homepage of your browser.
function setHome(){'url(#default#homepage)';
The following javascript function code adds the current address location to your browser’s Bookmarks list, and the document title is set as the title (name) of the Bookmark.
function setBookmark() {
      var title = document.title;
      var address =  window.location.href;
      if(window.sidebar) {
      } else if(window.external) {
      } else if(window.opera && window.print) { 
            var elem = document.createElement('a');
The problem with the above codes is that the ‘Homepage’ code works only in Internet Explorer, and the ‘Bookmark’ code is somewhat erry in Firefox (bookmarked page opens in sidebar).
But there is another option available though not javascript. The addthis site provides you with a custom button that can be added to your site/blog, that not only allows to bookmark your page but also provides you with data related to how and where the content is being shared.


  1. Is there any update available for Chrome ?

  2. The 'Set HomePage' functionality is not supported in Firefox/Chrome browsers, due to security concerns. Also it has been disabled in IE from IE8 version. The best workaround is to give your users instructions on how to manually set the home page.

  3. Thanks, I been trying to add bookmark for a while

  4. this is not working now on chrome

  5. nice info about bookmarking thank you i will check it for sure..


Related Posts Plugin for WordPress, Blogger...

Copyright © 2012 | ScriptSplash | Powered by Blogger Templates