|
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>
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.