rem:  var prefs = Components.classes["@mozilla.org/preferences-service;1"]; if ( prefs ) { prefs = prefs.getService(); if ( prefs ) { prefs = prefs.QueryInterface(Components.interfaces.nsIPrefBranch); editCard.prefs = prefs; } } 
add: editCard.prefs = gPrefs; 
context: function InitEditCard(){  gAddressBookBundle = document.getElementById("bundle_addressBook");  // create editCard object that contains global variables for editCard.js  editCard = new Object;  // get pointer to nsIPref object  var prefs = Components.classes["@mozilla.org/preferences-service;1"];  if ( prefs )  {    prefs = prefs.getService();    if ( prefs )    {      prefs = prefs.QueryInterface(Components.interfaces.nsIPrefBranch);      editCard.prefs = prefs;    }  }  // get specific prefs that editCard will need  if ( prefs )  {    try {      editCard.displayLastNameFirst = prefs.getBoolPref("mail.addr_book.displayName.lastnamefirst");      editCard.generateDisplayName = prefs.getBoolPref("mail.addr_book.displayName.autoGeneration");      editCard.lastFirstSeparator = ", ";      editCard.firstLastSeparator = " ";    }    catch (ex) {      dump("failed to get pref\n");    }  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/d08d4d3f9753b01573c0820f3dc3010c62295d11/abCardOverlay.js/clean/mailnews/addrbook/resources/content/abCardOverlay.js