Closed Bug 1408451 Opened 8 years ago Closed 8 years ago

Try logging to web console (not browser console) when blocking toplevel data URI navigations

Categories

(Core :: DOM: Security, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: ckerschb, Assigned: ckerschb)

References

Details

(Whiteboard: [domsecurity-active])

Attachments

(1 file)

I think we can query the actual document where the load occurs and use that document to provide context so the logging appears on the web console instead of the browser console.
Assignee: nobody → ckerschb
Blocks: 1401895
Status: NEW → ASSIGNED
Priority: -- → P1
Whiteboard: [domsecurity-active]
Boris, within docshell we can use the 'current document' to log to the web console (instead of the browser console). The redirect case is a little tricky because we loose the context (and hence the document) during serialization. In the end, the redirect case still logs to the browser console :-( but logging to the web console in the regular load/block case is definitely an improvement. If you prefer, we could query the windowId from the loadInfo, do FormatLocalizedString and friends ourselves within AllowTopLevelNavigationToDataURI() and call nsContentUtils::ReportToConsoleByWindowID() instead of ReportToConsole().
Attachment #8918828 - Flags: review?(bzbarsky)
Comment on attachment 8918828 [details] [diff] [review] bug_1408451_data_log_web_console.patch Seems OK. This is logging based on the "doc we would overwrite", not the "doc that started the load", but better than nothing.
Attachment #8918828 - Flags: review?(bzbarsky) → review+
Pushed by mozilla@christophkerschbaumer.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/8719c44ef3e2 Log to web console when blocking toplevel data: URI navigations. r=bz
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: