From: sullivan@apple.com Date: Sat, 10 Nov 2007 23:38:43 +0000 (+0000) Subject: Reviewed by Sam Weinig X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=8c9df870a8c695e2dc6432c4f551f02ffbaec3a1 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: https://svn.webkit.org/repository/webkit/trunk@27675 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 4dcc767771ee..bddeecaf74e7 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,14 @@ +2007-11-10 John Sullivan + + 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 Reviewed by Oliver. diff --git a/WebCore/bindings/js/kjs_window.cpp b/WebCore/bindings/js/kjs_window.cpp index dd63d2ae55cb..ba9d85a3863d 100644 --- a/WebCore/bindings/js/kjs_window.cpp +++ b/WebCore/bindings/js/kjs_window.cpp @@ -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; }