зеркало из https://github.com/mozilla/gecko-dev.git
Two about:blank related changes:
22400 - Don't show "about:blank" for "blank page" on new window open, r=smfr, a=alecf 37987 - Don't show "Document: done" for "about:blank", r=timeless, a=alecf
This commit is contained in:
Родитель
3a79a2ff9b
Коммит
a7a8d77441
|
@ -62,7 +62,6 @@ catch (ex)
|
||||||
var stopButton = null;
|
var stopButton = null;
|
||||||
var stopMenu = null;
|
var stopMenu = null;
|
||||||
var stopContext = null;
|
var stopContext = null;
|
||||||
var locationFld = null;
|
|
||||||
var backButton = null;
|
var backButton = null;
|
||||||
var forwardButton = null;
|
var forwardButton = null;
|
||||||
|
|
||||||
|
@ -210,10 +209,14 @@ function UpdateStatusField()
|
||||||
|
|
||||||
function nsXULBrowserWindow()
|
function nsXULBrowserWindow()
|
||||||
{
|
{
|
||||||
|
this.locationField = document.getElementById("urlbar");
|
||||||
}
|
}
|
||||||
|
|
||||||
nsXULBrowserWindow.prototype =
|
nsXULBrowserWindow.prototype =
|
||||||
{
|
{
|
||||||
|
locationField : null,
|
||||||
|
hideAboutBlank : true,
|
||||||
|
|
||||||
QueryInterface : function(iid)
|
QueryInterface : function(iid)
|
||||||
{
|
{
|
||||||
if(iid.equals(Components.interfaces.nsIXULBrowserWindow))
|
if(iid.equals(Components.interfaces.nsIXULBrowserWindow))
|
||||||
|
@ -324,10 +327,14 @@ nsXULBrowserWindow.prototype =
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(state & Components.interfaces.nsIWebProgressListener.STATE_IS_NETWORK) {
|
if(state & Components.interfaces.nsIWebProgressListener.STATE_IS_NETWORK) {
|
||||||
|
var location = channel.URI.spec;
|
||||||
|
var msg = "";
|
||||||
|
if (location != "about:blank") {
|
||||||
// Record page loading time.
|
// Record page loading time.
|
||||||
var elapsed = ( (new Date()).getTime() - startTime ) / 1000;
|
var elapsed = ( (new Date()).getTime() - startTime ) / 1000;
|
||||||
var msg = bundle.GetStringFromName("nv_done");
|
msg = bundle.GetStringFromName("nv_done");
|
||||||
msg = msg.replace(/%elapsed%/, elapsed);
|
msg = msg.replace(/%elapsed%/, elapsed);
|
||||||
|
}
|
||||||
defaultStatus = msg;
|
defaultStatus = msg;
|
||||||
UpdateStatusField();
|
UpdateStatusField();
|
||||||
// Turn progress meter off.
|
// Turn progress meter off.
|
||||||
|
@ -363,12 +370,15 @@ nsXULBrowserWindow.prototype =
|
||||||
},
|
},
|
||||||
onLocationChange : function(location)
|
onLocationChange : function(location)
|
||||||
{
|
{
|
||||||
if(!locationFld)
|
if (this.hideAboutBlank) {
|
||||||
locationFld = document.getElementById("urlbar");
|
this.hideAboutBlank = false;
|
||||||
|
if (location == "about:blank")
|
||||||
|
location = "";
|
||||||
|
}
|
||||||
|
|
||||||
// We should probably not do this if the value has changed since the user
|
// We should probably not do this if the value has changed since the user
|
||||||
// searched
|
// searched
|
||||||
locationFld.value = location;
|
this.locationField.value = location;
|
||||||
|
|
||||||
UpdateBackForwardButtons();
|
UpdateBackForwardButtons();
|
||||||
},
|
},
|
||||||
|
|
Загрузка…
Ссылка в новой задаче