rem: var profile = Components.classes["@mozilla.org/profile/manager;1"].getService(Components.interfaces.nsIProfileInternal); gProfileDirURL = gIOService.newFileURI(profile.getProfileDir(profile.currentProfile)); 
add: var dirService = Components.classes["@mozilla.org/directory_service;1"] .getService(Components.interfaces.nsIProperties); var profileDir = dirService.get("ProfD", Components.interfaces.nsIFile); gProfileDirURL = gIOService.newFileURI(profileDir); 
context: function setFromBuddyIcon(email){   var fromBuddyIcon = document.getElementById("fromBuddyIcon");   try {     // better to cache this?     var myScreenName = pref.getCharPref("aim.session.screenname");     var card = abAddressCollector.getCardFromAttribute("PrimaryEmail", email);     if (myScreenName && card && card.aimScreenName) {       if (!gIOService) {         // lazily create these globals         gIOService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);         gFileHandler = gIOService.getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler);                  var profile = Components.classes["@mozilla.org/profile/manager;1"].getService(Components.interfaces.nsIProfileInternal);         gProfileDirURL = gIOService.newFileURI(profile.getProfileDir(profile.currentProfile));       }       // if we did have a buddy icon on disk for this screenname, this would be the file url spec for it       var iconURLStr = gProfileDirURL.spec + "/NIM/" + myScreenName + "/picture/" + card.aimScreenName + ".gif";       // check if the file exists       // is this a perf hit?  (how expensive is stat()?)       var iconFile = gFileHandler.getFileFromURLSpec(iconURLStr);       if (iconFile.exists()) {         fromBuddyIcon.setAttribute("src", iconURLStr);         return;       }     }   }   catch (ex) {     // can get here if no screenname     //dump("ex = " + ex + "\n");   }   fromBuddyIcon.setAttribute("src", "");}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/d9ba66a275a5e97dde21555f69d35ddeb63479d9/msgHdrViewOverlay.js/clean/mail/base/content/msgHdrViewOverlay.js