我需要 jquery 中的脚本,使页面成为浏览器中的默认主页网站

Posted

技术标签:

【中文标题】我需要 jquery 中的脚本,使页面成为浏览器中的默认主页网站【英文标题】:i need script in jquery that make the page as your default home page website in the browser 【发布时间】:2009-12-02 13:17:52 【问题描述】:

我需要 jquery / javascript 中的脚本,使特定站点成为浏览器中的主页, 如果可能的话,我需要它与所有浏览器兼容。

我不是说它应该自动完成,

谢谢。

【问题讨论】:

在可能/可能的情况下,通常可以选择禁用它。许多人这样做是因为它至少很烦人,并且可能存在安全风险。 【参考方案1】:

在 Internet Explorer 7 和更早的版本中,可以使用

document.setHomePage("http://www.mywebsite.com/");

但是,这在较新的版本中是不可能的(因为它被认为存在安全风险),并且在其他浏览器(如 Firefox)中从未有过。

最好的后备方案是实际指导用户如何更改主页,而不是以编程方式尝试完成它。

在 Firefox(我不确定其他浏览器)中,用户可以将链接拖放到主页按钮上,从而(在确认后)更改起始页。您可以通过指示用户拖动图像(位于链接到您网站的锚标记内)并将其放在主页按钮上来利用此功能。

【讨论】:

【参考方案2】:

这是不可能的。这将是一个安全风险。

【讨论】:

【参考方案3】:

你不能。从 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]>

【讨论】:

以上是关于我需要 jquery 中的脚本,使页面成为浏览器中的默认主页网站的主要内容,如果未能解决你的问题,请参考以下文章

jQuery mobile 不加载新页面脚本

我需要将 jsFiddle 中的脚本放入工作 [关闭]

在Iframe中使用jquery ui dialog 怎么使弹出窗口居于浏览器中间

html dom中windows对象的4个常用子对象

使顺序 HTTP 请求成为节点中的阻塞操作吗?

使用 KendoUI Charts,如何使 Legend 项成为超链接?