Thursday, September 4, 2008

How to change "about:config" in firebox,netscape,google chrome Using Javascript

If you want to change about:config through javascript here is examble,

var browserName=navigator.appName; 
var browserVer=parseInt(navigator.appVersion);
var popsMode;
if (browserName=="Netscape" && browserVer>=5) {
    alert(browserName);
    alert(browserVer);
    popsMode=true;
    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
      if (prefs.getPrefType("dom.disable_window_open_feature.resizable") == prefs.PREF_BOOL){
        popsMode = prefs.getBoolPref("dom.disable_window_open_feature.resizable");
      }
   if (popsMode==true) {
   prefs.setBoolPref("dom.disable_window_open_feature.resizable",false);
   alert(popsMode);
   }
 }