popup blocker once again tolerates window.open targeted to _self, _top, et.al. reinstatement of bug 177526 (rev 1.557) messed up by rev 1.605, now bug 232933 r=bzbarsky,caillon

This commit is contained in:
danm-moz%comcast.net 2004-02-09 17:38:31 +00:00
Родитель e91170c526
Коммит cddbd4384d
1 изменённых файлов: 16 добавлений и 14 удалений

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

@ -3222,20 +3222,22 @@ PRBool GlobalWindowImpl::CheckOpenAllow(PRUint32 aAbuseLevel,
nsAutoString name(aName);
// _main is an IE target which should be case-insensitive but isn't
// see bug 217886 for details
if (!name.IsEmpty() &&
!name.EqualsIgnoreCase("_top") &&
!name.EqualsIgnoreCase("_self") &&
!name.EqualsIgnoreCase("_content") &&
!name.Equals(NS_LITERAL_STRING("_main"))) {
nsCOMPtr<nsIWindowWatcher> wwatch =
do_GetService(NS_WINDOWWATCHER_CONTRACTID);
if (wwatch) {
nsCOMPtr<nsIDOMWindow> namedWindow;
wwatch->GetWindowByName(PromiseFlatString(aName).get(), this,
getter_AddRefs(namedWindow));
if (namedWindow)
allowWindow = PR_TRUE;
if (!name.IsEmpty()) {
if (name.EqualsIgnoreCase("_top") ||
name.EqualsIgnoreCase("_self") ||
name.EqualsIgnoreCase("_content") ||
name.Equals(NS_LITERAL_STRING("_main")))
allowWindow = PR_TRUE;
else {
nsCOMPtr<nsIWindowWatcher> wwatch =
do_GetService(NS_WINDOWWATCHER_CONTRACTID);
if (wwatch) {
nsCOMPtr<nsIDOMWindow> namedWindow;
wwatch->GetWindowByName(PromiseFlatString(aName).get(), this,
getter_AddRefs(namedWindow));
if (namedWindow)
allowWindow = PR_TRUE;
}
}
}
}