我需要jquery / javascript中的脚本,使特定网站成为浏览器中的主页, 如果可能的话,我需要它兼容所有浏览器。
我不是说它应该自动完成,
感谢。
答案 0 :(得分:7)
在Internet Explorer 7及更早版本中,可以使用
执行此操作document.setHomePage("http://www.mywebsite.com/");
但是,这在最近的版本中是不可能的(因为它被认为是一种安全风险),并且在Firefox等其他浏览器中从未有过。
最好的后备是实际上指示用户如何更改主页而不是以编程方式尝试完成它。
在Firefox中(我不确定其他浏览器)用户可以拖动链接并将其放在主页按钮上,从而(确认后)更改起始页面。您可以通过指示用户拖动图像(位于链接到您网站的锚标记内)并将其放在主页按钮上来利用它。
答案 1 :(得分:2)
这是不可能的。这将是一种安全风险。
答案 2 :(得分:0)
你做不到。不是因为IE7。
<!--[if IE]>
Click on the "down" arrow just to the right of the "house" icon in
your Internet Explorer toolbar and choose "Add or Change Home Page."
Then click on "Use this webpage as your only home page" or
"Add this webpage to your home page tabs," depending on
your preference.
<![endif]-->
<![if !IE]>
To make this page your home page, just drag the icon to the left of the
URL in your location bar onto the "Home" icon in the "house" icon in
your toolbar. Some browsers do this differently. You can always set your
home page through the preferences of your browser.
<![endif]>