Commit 194b9ac8 authored by sullivan@apple.com's avatar sullivan@apple.com

Reviewed by Sam Weinig

        Rest of fix for 5394877

        * bindings/js/kjs_window.cpp:
        (KJS::Window::isSafeScript):
        Don't log unsafe JavaScript attempts in the other version of isSafeScript() if in
        private browsing mode either.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8f20e561
2007-11-10 John Sullivan <sullivan@apple.com>
Reviewed by Sam Weinig
Rest of fix for 5394877
* bindings/js/kjs_window.cpp:
(KJS::Window::isSafeScript):
Don't log unsafe JavaScript attempts in the other version of isSafeScript() if in
private browsing mode either.
2007-11-10 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by Oliver.
......
......@@ -936,15 +936,17 @@ bool Window::isSafeScript(ExecState *exec) const
if (actSecurityOrigin.canAccess(thisSecurityOrigin))
return true;
// FIXME: this error message should contain more specifics of why the same origin check has failed.
String message = String::format("Unsafe JavaScript attempt to access frame with URL %s from frame with URL %s. Domains, protocols and ports must match.\n",
thisDocument->URL().utf8().data(), actDocument->URL().utf8().data());
if (Interpreter::shouldPrintExceptions())
printf("%s", message.utf8().data());
if (Page* page = frame->page())
page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, 1, String());
if (!frame->settings()->privateBrowsingEnabled()) {
// FIXME: this error message should contain more specifics of why the same origin check has failed.
String message = String::format("Unsafe JavaScript attempt to access frame with URL %s from frame with URL %s. Domains, protocols and ports must match.\n",
thisDocument->URL().utf8().data(), actDocument->URL().utf8().data());
if (Interpreter::shouldPrintExceptions())
printf("%s", message.utf8().data());
if (Page* page = frame->page())
page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, 1, String());
}
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment