user2946610
user2946610

Reputation:

How to set my website as homepage for browsers by html code

I want to make a hyperlink for my website to set the browser homepage... someone told me the following code is useful, but it didn't work for me:

<a HREF onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.example.com');">
    <img src="house.gif">
    Click here to make us your Home Page
</a>

Upvotes: 0

Views: 6533

Answers (2)

guest1212433214
guest1212433214

Reputation: 1

If you don't want the small image to be on your website use this html code and where it says http://example.com <-- You need to use your website here

<a HREF onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.example.com');">
    Make as homepage
</a>

Upvotes: -1

Flash Thunder
Flash Thunder

Reputation: 12045

It is not possible with modern browsers, as it is considered as great security risk. setHomePage() javascript function have been removed few years ago.

Consider the case, that you click on some link, and it sets your homepage to some fake google page (for example one L is 1). Every time you think you are using a google, you may get some prepared results, in the best case - made to earn money from ads. But it may be much worse, a fake mail or bank site... or simply some porn site. Doesn't matter. It is dangerous.

Upvotes: 2

Related Questions