Index: webkit/pending/DOMWindow.cpp |
=================================================================== |
--- webkit/pending/DOMWindow.cpp (revision 2301) |
+++ webkit/pending/DOMWindow.cpp (working copy) |
@@ -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 @@ |
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(); |
} |