i need script in jquery that make the page as your default home page website in the browser

断了今生、忘了曾经 提交于 2019-12-02 04:50:45

问题


i need script in jquery / javascript that make the specific site as the homepage in the browser, i need it compatible for all browsers , if that possible .

i dont mean it should be done automatically ,

thanks.


回答1:


In Internet Explorer 7 and earlier it was possible to do this using

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

However, this is not possible in more recent version (as it is considered a security risk) and has never been possible in other browsers like Firefox.

The best fallback is to actually instruct the user how to change home page instead of programatically trying to accomplish it.

In Firefox (I'm not sure about other browsers) it is possible for the user to drag a link and drop it on the home button, and thereby (after confirming) changing the start page. You may utilize this by instructing the user to drag an image (that is inside an anchor tag linking to your website) and drop it on the home button.




回答2:


This isn't possible. That would be a security risk.




回答3:


You can't. Not since 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]>


来源:https://stackoverflow.com/questions/1832846/i-need-script-in-jquery-that-make-the-page-as-your-default-home-page-website-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!