Set default home page in JavaScript

前端 未结 3 1780
孤城傲影
孤城傲影 2020-12-03 20:08

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

3条回答
  •  心在旅途
    2020-12-03 20:41

    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.

提交回复
热议问题