Bug 472735: optimize about:blank onlocationchange (breakage fix), r=mfinkle

This commit is contained in:
Anton Rogaynis 2009-01-16 11:07:08 -05:00
Родитель 254552ee7f
Коммит 35f4aacbf5
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -1046,10 +1046,11 @@ ProgressController.prototype = {
onLocationChange: function(aWebProgress, aRequest, aLocationURI) { onLocationChange: function(aWebProgress, aRequest, aLocationURI) {
// XXX this code is not multiple-tab friendly. // XXX this code is not multiple-tab friendly.
var location = aLocationURI ? aLocationURI.spec : ""; var location = aLocationURI ? aLocationURI.spec : "";
let lastURI = selectedBrowser.lastURI let selectedBrowser = Browser.selectedBrowser;
let lastURI = selectedBrowser.lastURI;
//don't do anything for about:blank or about:firstrun on first display //don't do anything for about:blank or about:firstrun on first display
if (!lastURI && (location == "about:blank" || location == "about:firstrun" )) { if (!lastURI && (location == "about:blank" || location == "about:firstrun" )) {
return return;
} }
this._hostChanged = true; this._hostChanged = true;
@ -1062,7 +1063,6 @@ ProgressController.prototype = {
// <a href="#" onclick="return install();">Install Foo</a> // <a href="#" onclick="return install();">Install Foo</a>
// //
// - which fires a onLocationChange message to uri + '#'... // - which fires a onLocationChange message to uri + '#'...
let selectedBrowser = Browser.selectedBrowser;
selectedBrowser.lastURI = aLocationURI; selectedBrowser.lastURI = aLocationURI;
if (lastURI) { if (lastURI) {
var oldSpec = lastURI.spec; var oldSpec = lastURI.spec;