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