How do you set home page through java script for mozilla firefox?

Last post 06-27-2008 5:58 AM by sameer_khanjit. 7 replies.

Sort Posts:

  • How do you set home page through java script for mozilla firefox?

    06-23-2008, 7:14 AM
    Locked
    • Member
      2 point Member
    • thuypv
    • Member since 11-07-2007, 3:02 AM
    • Posts 5

     How do you set home page through java script for mozilla firefox? thanks

  • Re: How do you set home page through java script for mozilla firefox?

    06-23-2008, 8:35 AM
    Answer
    Locked
    • Participant
      1,465 point Participant
    • Rizwan328
    • Member since 05-25-2006, 10:26 AM
    • Dubai, UAE
    • Posts 349

     you can set home page with  setHomePage('url') javascript function

    If this post helps you, please mark it as Answer.



    Cheers,
    Muhammad Rizwan Javed
    Sr .Net Developer
    Aim 168, Dubai, UAE.
  • Re: How do you set home page through java script for mozilla firefox?

    06-23-2008, 11:11 AM
    Locked
    • Contributor
      3,091 point Contributor
    • sameer_khanjit
    • Member since 12-10-2007, 8:06 AM
    • Indore India
    • Posts 638


    <a class="chlnk" style="cursor:hand;font-weight:bold;color:#004080;font-family:Verdana" HREF onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.java-scripts.net');">Click here to make Java-scripts.net your default homepage!</a>

    We Are Looking for .NET/PHP Projects

    Contact Details :-

     Email - sameer.khanjit@gmail.com

     Mobile no. : +91-9893795983

     View Blog

    linkedin Asp.net Group

    Don't forget to click “Mark as Answer” on the post that helped you
  • Re: How do you set home page through java script for mozilla firefox?

    06-23-2008, 10:51 PM
    Locked
    • Member
      2 point Member
    • thuypv
    • Member since 11-07-2007, 3:02 AM
    • Posts 5

    sameer_khanjit:


    <a class="chlnk" style="cursor:hand;font-weight:bold;color:#004080;font-family:Verdana" HREF onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.java-scripts.net');">Click here to make Java-scripts.net your default homepage!</a>

     

    oh, thanks, but it only run on IE, but firefox don't run 

  • Re: How do you set home page through java script for mozilla firefox?

    06-24-2008, 1:32 AM
    Locked
    • Contributor
      3,091 point Contributor
    • sameer_khanjit
    • Member since 12-10-2007, 8:06 AM
    • Indore India
    • Posts 638

     ok i will check it let u know

    We Are Looking for .NET/PHP Projects

    Contact Details :-

     Email - sameer.khanjit@gmail.com

     Mobile no. : +91-9893795983

     View Blog

    linkedin Asp.net Group

    Don't forget to click “Mark as Answer” on the post that helped you
  • Re: How do you set home page through java script for mozilla firefox?

    06-26-2008, 3:28 AM
    Answer
    Locked
    Hi thuypv
     
    Based on my experience, we cannot set the home page of Firefox, if the browser set
    signed.applets.codebase_principal_support
    to false, the only thing we can do is remind use to change the setting. You can try the following code, both for IE and Firefox: 
    <script language="javascript">
    function setHomepage()
    {
     if (document.all)
        {
            document.body.style.behavior='url(#default#homepage)';
      document.body.setHomePage('http://www.asp.net/130.aspx');
     
        }
        else if (window.sidebar)
        {
        if(window.netscape)
        {
             try
       {  
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
             }  
             catch(e)  
             {  
        alert("this action was aviod by your browser,if you want to enable,please enter about:config in your address 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.asp.net/130.aspx');
     }
    }
    </script>
    <input type="button" value="set home page" onclick="setHomepage();" />
     
     
     
    If I’ve misunderstood your problem, please feel free to let me know.
     
    Thanks.
     
     

     

    Lance Zhang
  • Re: How do you set home page through java script for mozilla firefox?

    06-26-2008, 3:57 AM
    Locked
    • Member
      2 point Member
    • thuypv
    • Member since 11-07-2007, 3:02 AM
    • Posts 5

    ok, thanks, very thanks

  • Re: How do you set home page through java script for mozilla firefox?

    06-27-2008, 5:58 AM
    Locked
    • Contributor
      3,091 point Contributor
    • sameer_khanjit
    • Member since 12-10-2007, 8:06 AM
    • Indore India
    • Posts 638

    yes my javascript is not working on firfox.Lance Zhang have  already told you why..

    but still This is because of some security constraints of fir fox

     

    We Are Looking for .NET/PHP Projects

    Contact Details :-

     Email - sameer.khanjit@gmail.com

     Mobile no. : +91-9893795983

     View Blog

    linkedin Asp.net Group

    Don't forget to click “Mark as Answer” on the post that helped you
Page 1 of 1 (8 items)