Bug 100735 - X-Frame-Options console message should be associated with a request.
Summary: X-Frame-Options console message should be associated with a request.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mike West
URL:
Keywords:
Depends on: 99941
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-30 01:22 PDT by Mike West
Modified: 2012-10-31 06:33 PDT (History)
9 users (show)

See Also:


Attachments
Patch (15.77 KB, patch)
2012-10-30 03:05 PDT, Mike West
no flags Details | Formatted Diff | Diff
Patch for landing. (15.85 KB, patch)
2012-10-31 02:21 PDT, Mike West
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike West 2012-10-30 01:22:22 PDT
Currently, a frame blocked via X-Frame-Options in a meta tag sends "Refused to display document because display forbidden by X-Frame-Options." We should associate this message with the request that loaded the document in order to pull a stack trace/line number.
Comment 1 Mike West 2012-10-30 03:05:34 PDT
Created attachment 171407 [details]
Patch
Comment 2 Mike West 2012-10-30 03:12:35 PDT
Hi Pavel, Adam.

This patch depends on #99941, which adds the ability to tie a console message to a request. I'll throw it to the bots when that patch lands; it'll explode otherwise.

I'm not entirely sure I'm grabbing the request identifier correctly inside of Document. Adam, it looks like you added the console message there: can you evaluate the approach I've taken, as well as the new error message?

Pavel, this is more FYI for you. If you'd like me to move the additions to ScriptExecutionContext::addConsoleMessage into this patch and out of 99941, I'm happy to.

Thanks!
Comment 3 Mike West 2012-10-30 03:13:19 PDT
Actually CCing Adam and Pavel. See https://bugs.webkit.org/show_bug.cgi?id=100735#c2 for what should have been attached to this email. :)
Comment 4 Mike West 2012-10-30 03:18:16 PDT
Hrm. It went to the bots anyway. Oops.
Comment 5 Build Bot 2012-10-30 03:18:55 PDT
Comment on attachment 171407 [details]
Patch

Attachment 171407 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14631461
Comment 6 WebKit Review Bot 2012-10-30 03:19:30 PDT
Comment on attachment 171407 [details]
Patch

Attachment 171407 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14632434
Comment 7 Early Warning System Bot 2012-10-30 03:20:23 PDT
Comment on attachment 171407 [details]
Patch

Attachment 171407 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/14631463
Comment 8 Early Warning System Bot 2012-10-30 03:20:35 PDT
Comment on attachment 171407 [details]
Patch

Attachment 171407 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/14572059
Comment 9 Peter Beverloo (cr-android ews) 2012-10-30 03:22:30 PDT
Comment on attachment 171407 [details]
Patch

Attachment 171407 [details] did not pass cr-android-ews (chromium-android):
Output: http://queues.webkit.org/results/14632435
Comment 10 EFL EWS Bot 2012-10-30 03:29:09 PDT
Comment on attachment 171407 [details]
Patch

Attachment 171407 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/14627488
Comment 11 Build Bot 2012-10-30 03:40:19 PDT
Comment on attachment 171407 [details]
Patch

Attachment 171407 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/14629470
Comment 12 Pavel Feldman 2012-10-30 04:24:27 PDT
Comment on attachment 171407 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=171407&action=review

> Source/WebCore/dom/Document.cpp:2962
> +                String message = "Refused to display '" + url().string() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'.";

Do you intend to localize these?
Comment 13 Mike West 2012-10-30 04:31:54 PDT
(In reply to comment #12)
> (From update of attachment 171407 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=171407&action=review
> 
> > Source/WebCore/dom/Document.cpp:2962
> > +                String message = "Refused to display '" + url().string() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'.";
> 
> Do you intend to localize these?

Hrm. Hadn't thought about it, honestly. :)

Would that just involve adding another function to LocalizedString.cpp/h?
Comment 14 Pavel Feldman 2012-10-30 10:21:34 PDT
> Would that just involve adding another function to LocalizedString.cpp/h?

We don't really have a policy for that. It sounds like DOM exceptions are not localized, so it is up to you. I can only see context menus in LocalizedStrings.cpp + Chromium does not use those at all.
Comment 15 Mike West 2012-10-31 02:18:05 PDT
(In reply to comment #14)
> > Would that just involve adding another function to LocalizedString.cpp/h?
> 
> We don't really have a policy for that. It sounds like DOM exceptions are not localized, so it is up to you. I can only see context menus in LocalizedStrings.cpp + Chromium does not use those at all.

I've looked through the code; we don't localize any exceptions at all (at the moment (that I found)).

I think it might be worth doing, but not in this patch. :)
Comment 16 Mike West 2012-10-31 02:21:17 PDT
Created attachment 171603 [details]
Patch for landing.
Comment 17 WebKit Review Bot 2012-10-31 06:33:32 PDT
Comment on attachment 171603 [details]
Patch for landing.

Clearing flags on attachment: 171603

Committed r133019: <http://trac.webkit.org/changeset/133019>
Comment 18 WebKit Review Bot 2012-10-31 06:33:36 PDT
All reviewed patches have been landed.  Closing bug.