Bug 1387495 - 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 621295 375ad339788354a9787cbba648155319edf8b9be
parent 620862 32083f24a1bb2c33050b4c972783f066432194eb
child 640961 3593aef96f6012077feaedeaae923a90805b1446
push id72322
push userjdescottes@mozilla.com
push dateFri, 04 Aug 2017 16:00:51 +0000
reviewersjryans
bugs1387495
milestone57.0a1
Bug 1387495 - 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: