Bug 1291321 - Use system principal to download file:// stylesheets;r=gl
MozReview-Commit-ID: Fd8RoPGbZjz
--- 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;
});