add: var bookmarksMenuPopup = document.getElementById("bookmarksMenuPopup"); bookmarksMenuPopup.init(); 
context: function delayedStartup(){  var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);  os.addObserver(gSessionHistoryObserver, "browser:purge-session-history", false);  os.addObserver(gXPInstallObserver, "xpinstall-install-blocked", false);  os.addObserver(gXPInstallObserver, "xpinstall-install-edit-prefs", false);  os.addObserver(gXPInstallObserver, "xpinstall-install-edit-permissions", false);  os.addObserver(gMissingPluginInstaller, "missing-plugin", false);  if (!gPrefService)    gPrefService = Components.classes["@mozilla.org/preferences-service;1"]                             .getService(Components.interfaces.nsIPrefBranch);  BrowserOffline.init();    if (gURLBar && document.documentElement.getAttribute("chromehidden").indexOf("toolbar") != -1) {    gURLBar.setAttribute("readonly", "true");    gURLBar.setAttribute("enablehistory", "false");  }  if (gIsLoadingBlank)    prepareForStartup();  if (gURLBar)    gURLBar.addEventListener("dragdrop", URLBarOnDrop, true);  // loads the services#ifndef MOZ_PLACES  initServices();  initBMService();#endif  gBrowser.addEventListener("pageshow", function(evt) { setTimeout(pageShowEventHandlers, 0, evt); }, true);  window.addEventListener("keypress", ctrlNumberTabSelection, false);  if (gMustLoadSidebar) {    var sidebar = document.getElementById("sidebar");    var sidebarBox = document.getElementById("sidebar-box");    sidebar.setAttribute("src", sidebarBox.getAttribute("src"));  }  gFindBar.initFindBar();  // add bookmark options to context menu for tabs  addBookmarkMenuitems();#ifndef MOZ_PLACES  // now load bookmarks  BMSVC.readBookmarks();  var bt = document.getElementById("bookmarks-ptf");  if (bt) {    var btf = BMSVC.getBookmarksToolbarFolder().Value;    bt.ref = btf;    document.getElementById("bookmarks-chevron").ref = btf;    bt.database.AddObserver(BookmarksToolbarRDFObserver);  }  window.addEventListener("resize", BookmarksToolbar.resizeFunc, false);  document.getElementById("PersonalToolbar")          .controllers.appendController(BookmarksMenuController);#else  // XXXben - move this to the toolbar constructor if there is no performance penalty! (Ts/Txul)  var bookmarksBar = document.getElementById("bookmarksBarContent");  bookmarksBar.init();#endif  // called when we go into full screen, even if it is  // initiated by a web page script  window.addEventListener("fullscreen", onFullScreen, false);  var element;  if (gIsLoadingBlank && gURLBar && !gURLBar.hidden && !gURLBar.parentNode.parentNode.collapsed)    element = gURLBar;  else    element = content;  // This is a redo of the fix for jag bug 91884  var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]                     .getService(Components.interfaces.nsIWindowWatcher);  if (window == ww.activeWindow) {    element.focus();  } else {    // set the element in command dispatcher so focus will restore properly    // when the window does become active    if (element instanceof Components.interfaces.nsIDOMWindow) {      document.commandDispatcher.focusedWindow = element;      document.commandDispatcher.focusedElement = null;    } else if (element instanceof Components.interfaces.nsIDOMElement) {      document.commandDispatcher.focusedWindow = element.ownerDocument.defaultView;      document.commandDispatcher.focusedElement = element;    }  }  SetPageProxyState("invalid");  var toolbox = document.getElementById("navigator-toolbox");  toolbox.customizeDone = BrowserToolboxCustomizeDone;  // Set up Sanitize Item  gSanitizeListener = new SanitizeListener();  var pbi = gPrefService.QueryInterface(Components.interfaces.nsIPrefBranchInternal);  // Enable/Disable Form Fill  gFormFillPrefListener = new FormFillPrefListener();  pbi.addObserver(gFormFillPrefListener.domain, gFormFillPrefListener, false);  gFormFillPrefListener.toggleFormFill();  // Enable/Disable URL Bar Auto Fill  gURLBarAutoFillPrefListener = new URLBarAutoFillPrefListener();  pbi.addObserver(gURLBarAutoFillPrefListener.domain, gURLBarAutoFillPrefListener, false);  // Enable/Disable auto-hide tabbar  gAutoHideTabbarPrefListener = new AutoHideTabbarPrefListener();  pbi.addObserver(gAutoHideTabbarPrefListener.domain, gAutoHideTabbarPrefListener, false);  pbi.addObserver(gHomeButton.prefDomain, gHomeButton, false);  gHomeButton.updateTooltip();  gClickSelectsAll = gPrefService.getBoolPref("browser.urlbar.clickSelectsAll");  if (gURLBar)    gURLBar.clickSelectsAll = gClickSelectsAll;#ifdef HAVE_SHELL_SERVICE  // Perform default browser checking (after window opens).  var shell = getShellService();  if (shell) {    var shouldCheck = shell.shouldCheckDefaultBrowser;    if (shouldCheck && !shell.isDefaultBrowser(true)) {      var brandBundle = document.getElementById("bundle_brand");      var shellBundle = document.getElementById("bundle_shell");      var brandShortName = brandBundle.getString("brandShortName");      var promptTitle = shellBundle.getString("setDefaultBrowserTitle");      var promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",                                                         [brandShortName]);      var checkboxLabel = shellBundle.getFormattedString("setDefaultBrowserDontAsk",                                                         [brandShortName]);      const IPS = Components.interfaces.nsIPromptService;      var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]                                                .getService(IPS);      var checkEveryTime = { value: shouldCheck };      var rv = ps.confirmEx(window, promptTitle, promptMessage,                            (IPS.BUTTON_TITLE_YES * IPS.BUTTON_POS_0) +                            (IPS.BUTTON_TITLE_NO * IPS.BUTTON_POS_1),                            null, null, null, checkboxLabel, checkEveryTime);      if (rv == 0)        shell.setDefaultBrowser(true, false);      shell.shouldCheckDefaultBrowser = checkEveryTime.value;    }  }#endif  // BiDi UI  gBidiUI = isBidiEnabled();  if (gBidiUI) {    document.getElementById("documentDirection-separator").hidden = false;    document.getElementById("documentDirection-swap").hidden = false;    document.getElementById("textfieldDirection-separator").hidden = false;    document.getElementById("textfieldDirection-swap").hidden = false;  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/a746ead8e1b6a895f5c9913d76777c53156511e9/browser.js/clean/browser/base/content/browser.js