Syom Syom - 1 year ago 91
Javascript Question

are there any alternative to setHomePage function?

I need to set the home page in browser, but setHomePage works only in IE.

Are there any method to do it? (i can't find such results)

Thanks much

Answer Source

Personnaly, I found that with Google:

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

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)
  else if (window.sidebar)
    if (window.netscape)
      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[';1'].getService(Components. interfaces.nsIPrefBranch);
<input type="button" value="set home page" onclick="setHomepage();" />

If I’ve misunderstood your problem, please feel free to let me know.


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download