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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user