diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 46634813f7d7..9438ef48b6d3 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -254,23 +254,6 @@ function RegisterTabOpenObserver() #endif function Startup() { - var webNavigation; - try { - // Create the browser instance component. - appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"] - .createInstance(Components.interfaces.nsIBrowserInstance); - if (!appCore) - throw "couldn't create a browser instance"; - - webNavigation = getWebNavigation(); - if (!webNavigation) - throw "no XBL binding for browser"; - } catch (e) { - alert("Error launching browser window:" + e); - window.close(); // Give up. - return; - } - var uriToLoad = null; // Check for window.arguments[0]. If present, use that for uriToLoad. if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) @@ -346,6 +329,23 @@ function prepareForStartup() gProgressMeterPanel = document.getElementById("statusbar-progresspanel"); gBrowser.addEventListener("DOMUpdatePageReport", UpdatePageReport, false); + var webNavigation; + try { + // Create the browser instance component. + appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"] + .createInstance(Components.interfaces.nsIBrowserInstance); + if (!appCore) + throw "couldn't create a browser instance"; + + webNavigation = getWebNavigation(); + if (!webNavigation) + throw "no XBL binding for browser"; + } catch (e) { + alert("Error launching browser window:" + e); + window.close(); // Give up. + return; + } + // initialize observers and listeners window.XULBrowserWindow = new nsBrowserStatusHandler(); window.browserContentListener =