Bug 1291321 - Use system principal to download file:// stylesheets;r=gl
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 02 Sep 2016 15:38:48 +0200
changeset 354479 3fe5546bc877aa00eeb88dcf4adb38e12f82f14d
parent 354478 5c0e25ea512c72de6a462f4a0946fe9243cb04fe
child 354480 c35d8f056f6745e084a383ad3896afb8fd2facaa
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgl
bugs1291321
milestone51.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 1291321 - Use system principal to download file:// stylesheets;r=gl MozReview-Commit-ID: Fd8RoPGbZjz
devtools/server/actors/stylesheets.js
--- a/devtools/server/actors/stylesheets.js
+++ b/devtools/server/actors/stylesheets.js
@@ -455,20 +455,19 @@ var StyleSheetActor = protocol.ActorClas
       charset: this._getCSSCharset()
     };
 
     // Bug 1282660 - We use the system principal to load the default internal
     // stylesheets instead of the content principal since such stylesheets
     // require system principal to load. At meanwhile, we strip the loadGroup
     // for preventing the assertion of the userContextId mismatching.
     // The default internal stylesheets load from the 'resource:' URL.
-    // Bug 1287607 - The 'chrome:' URL will be also loaded from here, so we do
-    // the same thing for such URLs as well.
-    if (!/^resource:\/\//.test(this.href) &&
-        !/^chrome:\/\//.test(this.href)) {
+    // Bug 1287607, 1291321 - 'chrome' and 'file' protocols should also be handled in the
+    // same way.
+    if (!/^(chrome|file|resource):\/\//.test(this.href)) {
       options.window = this.window;
       options.principal = this.document.nodePrincipal;
     }
 
     return fetch(this.href, options).then(({ content }) => {
       this.text = content;
       return content;
     });