rem: pref.setCharPref(prefName, value); 
add: var str = Components.classes["@mozilla.org/supports-string;1"] .createInstance(nsISupportsString); str.data = value; pref.setComplexValue(prefName, nsISupportsString, str); 
context:   this.setValue = function(prefName, value) {    var prefType = typeof(value);    switch (prefType) {      case "string":      case "boolean":        break;      case "number":        if (value % 1 != 0) {          throw new Error("Cannot set preference to non integral number");        }        break;      default:        throw new Error("Cannot set preference with datatype: " + prefType);    }    // underlying preferences object throws an exception if new pref has a    // different type than old one. i think we should not do this, so delete    // old pref first if this is the case.    if (this.exists(prefName) && prefType != typeof(this.getValue(prefName))) {      this.remove(prefName);    }    // set new value using correct method    switch (prefType) {      case "string":        pref.setCharPref(prefName, value);        break;      case "boolean":        pref.setBoolPref(prefName, value);        break;      case "number":        pref.setIntPref(prefName, Math.floor(value));        break;    }  }
meta: 4236	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/4236/ef3e413efeb541ded3a628847a73e269323628ed/prefmanager.js/clean/src/chrome/chromeFiles/content/prefmanager.js