Bug 1369801 - dt-addon: use window object in webconsole/net/main to load stylesheets;r=jryans draft
authorJulian Descottes <jdescottes@mozilla.com>
Wed, 12 Jul 2017 19:26:33 +0200
changeset 615208 b00465e7e0ef8145b341c495eb27e7f1e703d341
parent 615207 99dfd4ae1efa4328b504ffd59b3b6d0205824685
child 615209 e7a70e68d359fe4a3249a6a5648a52abbde6d851
push id70267
push userjdescottes@mozilla.com
push dateTue, 25 Jul 2017 16:01:51 +0000
reviewersjryans
bugs1369801
milestone56.0a1
Bug 1369801 - dt-addon: use window object in webconsole/net/main to load stylesheets;r=jryans From console/net/main.js we are calling loadSheet from sdk/stylesheet/utils. This API needs a real window object to work, but now that devtools are loaded as a system addon, by default the global object is a sandbox wrapper. Use the window object which points to the actual Window instead. MozReview-Commit-ID: LxDNfDiOso3
devtools/client/webconsole/net/main.js
--- a/devtools/client/webconsole/net/main.js
+++ b/devtools/client/webconsole/net/main.js
@@ -33,17 +33,17 @@ var styleSheets = [
   "resource://devtools/client/webconsole/net/components/response-tab.css"
 ];
 
 // Load theme stylesheets into the Console frame. This should be
 // done automatically by UI Components as soon as we have consensus
 // on the right CSS strategy FIXME.
 // It would also be nice to include them using @import.
 styleSheets.forEach(url => {
-  loadSheet(this, url, "author");
+  loadSheet(window, url, "author");
 });
 
 // Localization API used by React components
 // accessing strings from *.properties file.
 // Example:
 //   let localizedString = Locale.$STR('string-key');
 //
 // Resources: