195833 - js error in onLocationChange when trying to get hostPort if there isn't one. r=jag, sr=bzbarsky

This commit is contained in:
shliang%netscape.com 2006-09-14 06:06:51 +00:00
Родитель 6c77ea4436
Коммит e6dc4caea8
1 изменённых файлов: 17 добавлений и 5 удалений

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

@ -294,6 +294,7 @@ nsBrowserStatusHandler.prototype =
{
this.setOverLink("");
var locationURI = null;
var location = "";
if (aLocation) {
@ -304,7 +305,9 @@ nsBrowserStatusHandler.prototype =
// If the url has "wyciwyg://" as the protocol, strip it off.
// Nobody wants to see it on the urlbar for dynamically generated
// pages.
location = gURIFixup.createExposableURI(aLocation).spec;
locationURI = gURIFixup.createExposableURI(aLocation);
location = locationURI.spec;
}
catch(ex) {
location = aLocation.spec;
@ -345,11 +348,20 @@ nsBrowserStatusHandler.prototype =
//clear popupDomain accordingly so that icon will go away when visiting
//an unblocked site after a blocked site. note: if a popup is blocked
//the icon will stay as long as we are in the same domain.
if (blank ||
!("popupDomain" in browser) ||
aLocation.hostPort != browser.popupDomain) {
!("popupDomain" in browser)) {
browser.popupDomain = null;
}
else {
var hostPort = "";
try {
hostPort = locationURI.hostPort;
}
catch(ex) { }
if (hostPort != browser.popupDomain)
browser.popupDomain = null;
}
var popupIcon = document.getElementById("popupIcon");
popupIcon.hidden = !browser.popupDomain;