Posted By

tcelestino on 11/19/10


Tagged

browser jquery


Versions (?)

add home page your browser


 / Published in: jQuery
 

  1. function setHomepage()
  2. {
  3. if (document.all)
  4. {
  5. document.body.style.behavior='url(#default#homepage)';
  6. document.body.setHomePage('url you site');
  7. }
  8. else if (window.sidebar)
  9. {
  10. if(window.netscape)
  11. {
  12. try
  13. {
  14. netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
  15. }
  16. catch(e)
  17. {
  18. 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");
  19. }
  20. }
  21. var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
  22. prefs.setCharPref('browser.startup.homepage','url you site');
  23. }
  24. }

Report this snippet  

You need to login to post a comment.