rem: var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface(Components.interfaces.nsIAppShellService); 
add: var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"] .getService(Components.interfaces.nsIAppStartup); 
context: function applyTheme(themeName){  var id = themeName.getAttribute('id');   var name=id.substring('urn:mozilla.skin.'.length, id.length);  if (!name)    return;  var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"]    .getService(Components.interfaces.nsIChromeRegistrySea);  var oldTheme = false;  try {    oldTheme = !chromeRegistry.checkThemeVersion(name);  }  catch(e) {  }  var str = Components.classes["@mozilla.org/supports-string;1"]                      .createInstance(Components.interfaces.nsISupportsString);  var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);  if (oldTheme) {    var title = gNavigatorBundle.getString("oldthemetitle");    var message = gNavigatorBundle.getString("oldTheme");    message = message.replace(/%theme_name%/, themeName.getAttribute("displayName"));    message = message.replace(/%brand%/g, gBrandBundle.getString("brandShortName"));    if (promptService.confirm(window, title, message)){      var inUse = chromeRegistry.isSkinSelected(name, true);      chromeRegistry.uninstallSkin( name, true );      // XXX - this sucks and should only be temporary.      str.data = true;      pref.setComplexValue("general.skins.removelist." + name,                           Components.interfaces.nsISupportsString, str);            if (inUse)        chromeRegistry.refreshSkins();    }    return;  } // XXX XXX BAD BAD BAD BAD !! XXX XXX                                          // we STILL haven't fixed editor skin switch problems                          // hacking around it yet again                                                 str.data = name; pref.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString, str);  // shut down quicklaunch so the next launch will have the new skin var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface(Components.interfaces.nsIAppShellService); try {   appShell.nativeAppSupport.isServerMode = false; } catch(ex) { }  if (promptService) {                                                             var dialogTitle = gNavigatorBundle.getString("switchskinstitle");              var brandName = gBrandBundle.getString("brandShortName");                      var msg = gNavigatorBundle.getFormattedString("switchskins", [brandName]);     promptService.alert(window, dialogTitle, msg);                               }                                                                             }
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/964081153ab7c4e16a443d420595838de9b07b6a/navigator.js/clean/suite/browser/navigator.js