Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Misc | Q1350 [ previous next ]

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>

©2018 Martin Webb