Firefox _javascript tips for the homepage of JavaScript code

Source: Internet
Author: User
Under IE, we can easily use the following code to implement the Settings home page:

Click here to make devdao.com your default homepage!
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

However, it's not going to work under Firefox.

To use a script to set up a home page under Firefox, you must first confirm that in the browser's "About:config",
Signed.applets.codebase_principal_support
Set to True

Then use the following script:
<textarea id="runcode91896"><script language= "JavaScript" > Function setHomePage () {if (document.all) {document.body.style.behavior= ' URL (#default #homepage) '; Document.body.setHomePage (' http://www.jb51.net '); The else if (Window.sidebar) {if (Window.netscape) {try {netscape.security.PrivilegeManager.enablePrivilege ("Univer Salxpconnect "); catch (E) {alert ("This action is aviod by your browser,if you want to enable,please enter About:config in your Addre SS Line,and Change the value of Signed.applets.codebase_principal_support to true "); } var prefs = components.classes[' @mozilla. Org/preferences-service;1 '].getservice (components. Interfaces.nsiprefbranch); Prefs.setcharpref (' browser.startup.homepage ', ' http://www.jb51.net '); } </script> <input type= "button" value= "Set home page" onclick= "setHomePage ();"/></textarea>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.