Closed Thread Icon

Topic awaiting preservation: setting Netscape homepage (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8272" title="Pages that link to Topic awaiting preservation: setting Netscape homepage (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: setting Netscape homepage <span class="small">(Page 1 of 1)</span>\

 
Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 08-22-2002 19:28

I have this:

<script type="text/javascript" language="javascript">
function setnshome(where){
netscape.security.PrivilegeManager.enablePrivilege('UniversalPreferencesWrite');
navigator.preference('browser.startup.homepage',where);
}
</script>
<a href="#" onclick="setnshome('http://www.ozoneasylum.com');">do it</a>

and it works fine. But I'd like to pass document.location to it to make the current page the homepage. I can't seem to get it to work right. Ideas?

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 08-22-2002 19:50

Could you show us the code of a failed attempt?

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 08-22-2002 20:27

I guess that would help!

<script type="text/javascript" language="javascript">
function setnshome(where){
netscape.security.PrivilegeManager.enablePrivilege('UniversalPreferencesWrite');
navigator.preference('browser.startup.homepage',where);
}
</script>
<a href="#" onclick="setnshome(document.location);">do it</a>

I get the correct prompt in NS, but it doesn't change it to the current page.

I've also tried

<script type="text/javascript" language="javascript">
function setnshome(){
netscape.security.PrivilegeManager.enablePrivilege('UniversalPreferencesWrite');
navigator.preference('browser.startup.homepage',document.location);
}
</script>
<a href="#" onclick="setnshome();">do it</a>

and that doesn't work either.

meccaman
Nervous Wreck (II) Inmate

From:
Insane since: Aug 2002

posted posted 08-22-2002 20:43

Have you tried using document.location.href?
I don't have NS to test it on at the moment, but I remember doing a similiar thing in IE and using document.location wasn't giving me the document's URL, but using document.location.href did.



[This message has been edited by meccaman (edited 08-22-2002).]

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 08-22-2002 23:40

Ah!

That appears to be it....

Thanks.

Anyone else doing some cool Netscape feature stuff online? I'm looking for ideas.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 08-23-2002 01:19

Strange. document.location should work, I thought. And I didn't think document.location.href would. Oh well. There's a difference between just location (window.location) and document.location (window.document.location), and the former, i thought, was the only one what supported the href property.

« BackwardsOnwards »

Show Forum Drop Down Menu