Commit 4b5a82dc authored by sullivan@apple.com's avatar sullivan@apple.com

Reviewed by Tim Hatcher

        - fixed <rdar://problem/5394877> Safari should not log unsafe JavaScript attempts when 
          in private browsing mode (only an issue if Log JavaScript Exceptions is turned on)

        * bindings/js/kjs_window.cpp:
        (KJS::Window::isSafeScript):
        Don't log unsafe JavaScript attempts to console or chromeClient if in private browsing mode



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e962e996
2007-11-10 John Sullivan <sullivan@apple.com>
Reviewed by Tim Hatcher
- fixed <rdar://problem/5394877> Safari should not log unsafe JavaScript attempts when
in private browsing mode (only an issue if Log JavaScript Exceptions is turned on)
* bindings/js/kjs_window.cpp:
(KJS::Window::isSafeScript):
Don't log unsafe JavaScript attempts to console or chromeClient if in private browsing mode
2007-11-10 Alexey Proskuryakov <ap@webkit.org> 2007-11-10 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin. Reviewed by Darin.
......
...@@ -893,17 +893,18 @@ bool Window::isSafeScript(const ScriptInterpreter *origin, const ScriptInterpret ...@@ -893,17 +893,18 @@ bool Window::isSafeScript(const ScriptInterpreter *origin, const ScriptInterpret
originDomain = ancestorFrame->document()->domain(); originDomain = ancestorFrame->document()->domain();
} }
if ( targetDomain == originDomain ) if (targetDomain == originDomain)
return true; return true;
if (Interpreter::shouldPrintExceptions()) { if (!originFrame->settings()->privateBrowsingEnabled()) {
printf("Unsafe JavaScript attempt to access frame with URL %s from frame with URL %s. Domains must match.\n", if (Interpreter::shouldPrintExceptions())
targetDocument->URL().latin1(), originDocument->URL().latin1()); printf("Unsafe JavaScript attempt to access frame with URL %s from frame with URL %s. Domains must match.\n",
targetDocument->URL().latin1(), originDocument->URL().latin1());
String message = String::format("Unsafe JavaScript attempt to access frame with URL %s from frame with URL %s. Domains must match.\n",
targetDocument->URL().latin1(), originDocument->URL().latin1());
if (Page* page = targetFrame->page())
page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, 1, String()); // FIXME: provide a real line number and source URL.
} }
String message = String::format("Unsafe JavaScript attempt to access frame with URL %s from frame with URL %s. Domains must match.\n",
targetDocument->URL().latin1(), originDocument->URL().latin1());
if (Page* page = targetFrame->page())
page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, 1, String()); // FIXME: provide a real line number and source URL.
return false; 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