зеркало из 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
|
||||
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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче