allow close from JS to close non-JS windows. bug 9703.

This commit is contained in:
danm%netscape.com 1999-08-09 22:28:09 +00:00
Родитель 9aab80c6e9
Коммит ed2017307f
1 изменённых файлов: 9 добавлений и 8 удалений

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

@ -1297,14 +1297,15 @@ GlobalWindowImpl::Blur()
NS_IMETHODIMP
GlobalWindowImpl::Close()
{
// Basic security check. If window has opener and therefore was opened from JS it can be
// closed. Need to add additional checks and privilege based closing
if (nsnull != mOpener) {
nsIBrowserWindow *mBrowser;
if (NS_OK == GetBrowserWindowInterface(mBrowser)) {
mBrowser->Close();
NS_RELEASE(mBrowser);
}
// Note: the basic security check, rejecting windows not opened through JS,
// has been removed. This was approved long ago by ...you're going to call me
// on this, aren't you... well it was. And anyway, a better means is coming.
// In the new world of application-level interfaces being written in JS, this
// security check was causing problems.
nsIBrowserWindow *mBrowser;
if (NS_OK == GetBrowserWindowInterface(mBrowser)) {
mBrowser->Close();
NS_RELEASE(mBrowser);
}
return NS_OK;
}