Index: Source/core/frame/LocalFrame.cpp |
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp |
index adf955136f8047b493c56ea2d3ef0d821d8a6c48..ba4d9045f02f097308c805d231cc329c83d6aaac 100644 |
--- a/Source/core/frame/LocalFrame.cpp |
+++ b/Source/core/frame/LocalFrame.cpp |
@@ -286,6 +286,18 @@ SecurityContext* LocalFrame::securityContext() const |
return document(); |
} |
+void LocalFrame::printNavigationErrorMessage(const Frame& targetFrame, const char* reason) |
+{ |
+ if (!targetFrame.isLocalFrame()) |
+ return; |
+ |
+ const LocalFrame& targetLocalFrame = toLocalFrameTemporary(targetFrame); |
+ String message = "Unsafe JavaScript attempt to initiate navigation for frame with URL '" + targetLocalFrame.document()->url().string() + "' from frame with URL '" + document()->url().string() + "'. " + reason + "\n"; |
+ |
+ // FIXME: should we print to the console of the document performing the navigation instead? |
+ targetLocalFrame.localDOMWindow()->printErrorMessage(message); |
+} |
+ |
void LocalFrame::disconnectOwnerElement() |
{ |
if (owner()) { |