add:  var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); prefService.savePrefFile(null); 
context: function onOk(){   if (gArrayHdrs.length)  {    var hdrs = gArrayHdrs.join(": ");    gPrefs.setCharPref("mailnews.customHeaders", hdrs);  }  window.close();}
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/b964325b464f482a32602850da214142df3e6414/CustomHeaders.js/buggy/mailnews/base/search/resources/content/CustomHeaders.js