From 96737d7dcf7057c1c244d3de45b7c4166939fc29 Mon Sep 17 00:00:00 2001 From: "disttsc%bart.nl" Date: Thu, 14 Sep 2006 05:57:02 +0000 Subject: [PATCH] When opening a new window, place the uri to load in the location bar. If the load is somehow interrupted, you'll now have the uri you wanted there instead of nothing. bug=70682, r=mao, sr=ben git-svn-id: svn://10.0.0.236/trunk@210726 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/suite/browser/navigator.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/mozilla/suite/browser/navigator.js b/mozilla/suite/browser/navigator.js index b41c0f1dc86..7b8cfb148db 100644 --- a/mozilla/suite/browser/navigator.js +++ b/mozilla/suite/browser/navigator.js @@ -513,28 +513,30 @@ function Startup() // only load url passed in when we're not page cycling if (!isPageCycling) { - var startPage; + var uriToLoad; if (!appCore.cmdLineURLUsed) { var cmdLineService = Components.classes["@mozilla.org/appshell/commandLineService;1"] .getService(Components.interfaces.nsICmdLineService); - startPage = cmdLineService.URLToLoad; - if (!startPage) { + uriToLoad = cmdLineService.URLToLoad; + if (!uriToLoad) { var cmdLineHandler = Components.classes["@mozilla.org/commandlinehandler/general-startup;1?type=browser"] .getService(Components.interfaces.nsICmdLineHandler); - startPage = cmdLineHandler.defaultArgs; + uriToLoad = cmdLineHandler.defaultArgs; } appCore.cmdLineURLUsed = true; } - if (!startPage) { - // Check for window.arguments[0]. If present, use that for startPage. + if (!uriToLoad) { + // Check for window.arguments[0]. If present, use that for uriToLoad. if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) - startPage = window.arguments[0]; + uriToLoad = window.arguments[0]; } - if (startPage && startPage != "about:blank") - loadURI(startPage); + if (uriToLoad && uriToLoad != "about:blank") { + gURLBar.value = uriToLoad; + loadURI(uriToLoad); + } // Focus the content area if the caller instructed us to. if ("arguments" in window && window.arguments.length >= 3 && window.arguments[2] == true)