зеркало из https://github.com/mozilla/gecko-dev.git
allow close from JS to close non-JS windows. bug 9703.
This commit is contained in:
Родитель
9aab80c6e9
Коммит
ed2017307f
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче