add:  if ("arguments" in window) { try { var params = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); gDownloadManager.addDownloads(params); } catch (e) { if (window.arguments[0] == "updatecheck") checkUpdatesAll(); else if (window.arguments[0] == "updates-only") { gUpdatesOnly = true; document.getElementById("viewGroup").hidden = true; document.getElementById("extensionsView").setAttribute("norestart", ""); showView('updates'); var addonsMsg = document.getElementById("addonsMsg"); addonsMsg.showMessage("chrome: getExtensionString("newUpdatesAvailableMsg"), null, null, true, null); document.title = getExtensionString("newUpdateWindowTitle", [getBrandShortName()]); } } }  if (gExtensionsView.selectedItem) gExtensionsView.scrollBoxObject.scrollToElement(gExtensionsView.selectedItem);  gPref.setBoolPref(PREF_UPDATE_NOTIFYUSER, false); 
context: function Startup() {  var startupView = window.location.search.substr("?view=".length, window.location.search.length);  gExtensionStrings = document.getElementById("extensionsStrings");  gPref = Components.classes["@mozilla.org/preferences-service;1"]                    .getService(Components.interfaces.nsIPrefBranch);  var defaultPref = gPref.QueryInterface(Components.interfaces.nsIPrefService)                         .getDefaultBranch(null);  try {    gCurrentTheme = gPref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN);    gDefaultTheme = defaultPref.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN);  }  catch (e) { }    gExtensionsView = document.getElementById("extensionsView");  gExtensionManager = Components.classes["@mozilla.org/extensions/manager;1"]                                .getService(Components.interfaces.nsIExtensionManager)                                .QueryInterface(Components.interfaces.nsIExtensionManager_MOZILLA_1_8_BRANCH);  var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]                          .getService(Components.interfaces.nsIXULAppInfo)                          .QueryInterface(Components.interfaces.nsIXULRuntime);  gInSafeMode = appInfo.inSafeMode;  gAppID = appInfo.ID;  updateOptionalViews();    try {    gCheckCompat = gPref.getBoolPref(PREF_EM_CHECK_COMPATIBILITY);  } catch(e) { }  // Sort on startup and anytime an add-on is installed or upgraded.  gExtensionManager.sortTypeByProperty(nsIUpdateItem.TYPE_ADDON, "name", true);  // Extension Command Updating is handled by a command controller.  gExtensionsView.controllers.appendController(gExtensionsViewController);  gExtensionsView.addEventListener("select", onAddonSelect, false);  gExtensionsView.database.AddDataSource(gExtensionManager.datasource);  gExtensionsView.setAttribute("ref", RDFURI_ITEM_ROOT);  var viewGroup = document.getElementById("viewGroup");  if (startupView == "installs")    showView("installs");  else if (viewGroup.hasAttribute("last-selected"))    showView(viewGroup.getAttribute("last-selected"));  else    showView("extensions");  gExtensionsView.focus();  gExtensionsViewController.onCommandUpdate();     // Now look and see if we're being opened by XPInstall  gDownloadManager = new XPInstallDownloadManager();  var os = Components.classes["@mozilla.org/observer-service;1"]                     .getService(Components.interfaces.nsIObserverService);  os.addObserver(gDownloadManager, "xpinstall-download-started", false);  os.addObserver(gAddonsMsgObserver, "addons-message-notification", false);  gObserverIndex = gExtensionManager.addUpdateListener(gDownloadManager);    if ("arguments" in window) {    try {      var params = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock);      gDownloadManager.addDownloads(params);    }    catch (e) {      if (window.arguments[0] == "updatecheck")        checkUpdatesAll();    }  }  if (gExtensionsView.selectedItem)    gExtensionsView.scrollBoxObject.scrollToElement(gExtensionsView.selectedItem);  if (!gCheckCompat) {    var msgText = getExtensionString("disabledCompatMsg");    var buttonLabel = getExtensionString("enableButtonLabel");    var buttonAccesskey = getExtensionString("enableButtonAccesskey");    var notifyData = "addons-enable-compatibility";    var addonsMsg = document.getElementById("addonsMsg");    addonsMsg.showMessage("chrome://mozapps/skin/extensions/question.png",                          msgText, buttonLabel, buttonAccesskey,                          true, notifyData);  }  if (gInSafeMode) {    var addonsMsg = document.getElementById("addonsMsg");    addonsMsg.showMessage("chrome://mozapps/skin/extensions/question.png",                          getExtensionString("safeModeMsg"),                          null, null, true, null);  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/f95efb0b36b96ac3522fe76dc32fa989927ac4cd/extensions.js/clean/toolkit/mozapps/extensions/content/extensions.js