Bug 1201535 - Mark srcdoc as safe for loading in child. r=bz
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 22 Sep 2015 21:59:13 -0500
changeset 264296 83e1422aecc8b79316839b5bcbd16b859c2f0426
parent 264295 82fd00bfb1dd714660b060465642f103c2d72f08
child 264297 9efdda8b4a180ba0df8f3f80dc9e50ca6c2d6abe
push id65590
push userkwierso@gmail.com
push dateFri, 25 Sep 2015 00:14:23 +0000
treeherdermozilla-inbound@0ab67cace54f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1201535
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1201535 - Mark srcdoc as safe for loading in child. r=bz When showing view source of a srcdoc frame in a tab, we load the frame content via a page descriptor and use the URI "view-source:about:srcdoc". Since we are creating a browser tab, the docshell's `InternalLoad` triggers the browser's `shouldLoadURI` machinery that checks if we are in the correct process for the given URI. This machinery will unwrap "view-source:" to "about:srcdoc" and check if such an about page can be loaded in the child. Marking "about:srcdoc" as safe for the child to load allows the view source content of the frame to be displayed as expected.
docshell/base/nsAboutRedirector.cpp
--- a/docshell/base/nsAboutRedirector.cpp
+++ b/docshell/base/nsAboutRedirector.cpp
@@ -99,17 +99,18 @@ static RedirEntry kRedirMap[] = {
     nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
     nsIAboutModule::ALLOW_SCRIPT
   },
   // about:srcdoc is unresolvable by specification.  It is included here
   // because the security manager would disallow srcdoc iframes otherwise.
   {
     "srcdoc", "about:blank",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
-      nsIAboutModule::HIDE_FROM_ABOUTABOUT
+      nsIAboutModule::HIDE_FROM_ABOUTABOUT |
+      nsIAboutModule::URI_CAN_LOAD_IN_CHILD
   },
   {
     "support", "chrome://global/content/aboutSupport.xhtml",
     nsIAboutModule::ALLOW_SCRIPT
   },
   {
     "telemetry", "chrome://global/content/aboutTelemetry.xhtml",
     nsIAboutModule::ALLOW_SCRIPT