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