Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1350 Is there a way to change the default page of the browser through JavaScript?

irt.org | Knowledge Base | JavaScript | Misc | Q1350 [ previous next ]

Q1350 Is there a way to change the default page of the browser through JavaScript?

In Internet Explorer yes. In Netscape only with a signed script although it will work unsigned from a file on your local disk.

<script language="JavaScript"><!--
function setNSHomepage(URL) {
    netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
    navigator.preference('browser.startup.homepage',URL);
}
//-></script>

<a href="javascript:;"
  onClick="HomePage = top.location.href;
  if (document.layers)
      setNSHomepage(HomePage);
  else if (document.all) {
      this.style.behavior='url(#default#homepage)';
      this.setHomePage(HomePage);
  }
  else
      alert('sorry, not supported in this browser');
  return false
">Set this page as your homepage</a>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.