summaryrefslogtreecommitdiffstats
path: root/webkit/pending/DOMWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/pending/DOMWindow.cpp')
-rw-r--r--webkit/pending/DOMWindow.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/webkit/pending/DOMWindow.cpp b/webkit/pending/DOMWindow.cpp
index d01eb9a..85a5a86 100644
--- a/webkit/pending/DOMWindow.cpp
+++ b/webkit/pending/DOMWindow.cpp
@@ -46,6 +46,7 @@
#include "PlatformScreen.h"
#include "PlatformString.h"
#include "Screen.h"
+#include "Settings.h"
#include <algorithm>
#include <wtf/MathExtras.h>
@@ -345,7 +346,13 @@ void DOMWindow::close()
if (!m_frame)
return;
- if (m_frame->loader()->openedByDOM() || m_frame->loader()->getHistoryLength() <= 1)
+ Settings* settings = m_frame->settings();
+ bool allow_scripts_to_close_windows =
+ (settings && settings->allowScriptsToCloseWindows());
+
+ if (m_frame->loader()->openedByDOM()
+ || m_frame->loader()->getHistoryLength() <= 1
+ || allow_scripts_to_close_windows)
m_frame->scheduleClose();
}