3

How do I create a link to set the user's home page to my URL?

skaffman
  • 398,947
  • 96
  • 818
  • 769

3 Answers3

7

As some people have already answered, it used to be possible in internet explorer (prior to IE 7 I believe, could be wrong though) using something similar to

document.setHomePage('www.example.com');

I don't think any browser supports it anymore though. However, I would definitely try to convince you to do otherwise. Most people won't like having their settings automatically changed, even if it's triggered by a mouse click or other action. It's also quite likely that overzealous 'protection' programs will jump all over it and stamp it as a malicious attack.

falstro
  • 34,597
  • 9
  • 72
  • 86
2

As far as I know it's just possible in Internet Explorer

Make my Page your
<a href="javascript:history.go(0)" onClick="this.style.behavior='url(#default#homepage)';
 this.setHomePage('http://www.test.de');">Startpage</a>.
Xn0vv3r
  • 17,766
  • 13
  • 58
  • 65
  • This seems to work fine in IE7 with the exception that I got a "reload/retry" warning with the page I was using. I changed it to `href=""` and that fixed it. Thanks. – thornomad Aug 24 '11 at 15:35
0

I assume you mean put a link in your page to make it the browser homepage? In IE you can do something like:

this.setHomePage('http://www.mysite.com');

I don't think that works in Firefox though.

Steven Robbins
  • 26,441
  • 7
  • 76
  • 90