rem: var prefCount = {value:0}; var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); var prefBranch = prefService.getBranch(null); var prefArray = prefBranch.getChildList("" , prefCount); var prefName, prefType, prefValue, prefIndex, prefLockState; 
add: var prefCount = { value: 0 }; var prefArray = gPrefBranch.getChildList("", prefCount); 
context: function onConfigLoad(){    document.title = "about:config";    var prefCount = {value:0};    var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);    var prefBranch = prefService.getBranch(null);    var prefArray = prefBranch.getChildList("" , prefCount);    var prefName, prefType, prefValue, prefIndex, prefLockState;    var i = 0;    var j = 0;   // This is used to avoid counting the "capability" preferences    var k = 0;	 // This is to maintain a count of prefs (not including the "capability" prefs);    prefArray.sort();    for (i = 0; i < prefCount.value; i++)     {        if((prefArray[i].indexOf("capability", 0) + 1) > 0)    // avoid displaying "private" preferences        {            j++;            continue;        }        k = (i - j);   // avoid numbering "capability" prefs        prefIndex = k + 1;	        if (prefBranch.prefIsLocked(prefArray[i]))          prefLockState = kLocked;        else if(prefBranch.prefHasUserValue(prefArray[i]))          prefLockState = kUserSet;        else          prefLockState = kDefault;        const nsIPrefBranch = Components.interfaces.nsIPrefBranch;        switch (prefBranch.getPrefType(prefArray[i])) {            case nsIPrefBranch.PREF_INT:            prefType = kIntType;            // convert to a string            prefValue = "" + prefBranch.getIntPref(prefArray[i]);                break;            case nsIPrefBranch.PREF_BOOL:            prefType = kBoolType;            // convert to a string            if (prefBranch.getBoolPref(prefArray[i]))              prefValue = "true";            else              prefValue = "false";                break;          case nsIPrefBranch.PREF_STRING:            default:             prefType = kStrType;            prefValue = htmlEscape(prefBranch.getCharPref(prefArray[i]));                break;        }        prefArray[i] = htmlEscape(prefArray[i]);        baseArray[k] = {indexCol:prefIndex, prefCol:prefArray[i], lockCol:prefLockState, typeCol:prefType, valueCol:prefValue};    }    view.rowCount = k + 1;    gTree = document.getElementById("configTree");    gTree.treeBoxObject.view = view;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/1c150b0e04775ca751b4a5c7eb9a1306e4370c37/config.js/clean/xpfe/global/resources/content/config.js