Bug 1224751 - Use the window's console in BrowserLoader. r=jlongster draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Wed, 20 Jan 2016 12:34:44 -0600
changeset 323620 cd01f7bfacf5d8799a2d843475c4a1475ef8ffe5
parent 323349 f55593fee5fcba46d7bc3afea9fd75f5d03dde59
child 513243 789b0930b3d5a0683bc10d109de9de50b871c3ca
push id9753
push userjryans@gmail.com
push dateWed, 20 Jan 2016 18:36:05 +0000
reviewersjlongster
bugs1224751
milestone46.0a1
Bug 1224751 - Use the window's console in BrowserLoader. r=jlongster
devtools/client/shared/browser-loader.js
--- a/devtools/client/shared/browser-loader.js
+++ b/devtools/client/shared/browser-loader.js
@@ -65,16 +65,19 @@ function BrowserLoader(baseURI, window) 
 
       if (!uri.startsWith(baseURI) && !isBrowserDir) {
         return devtools.require(uri);
       }
 
       return require(uri);
     },
     globals: {
+      // Allow modules to use the window's console to ensure logs appear in a
+      // tab toolbox, if one exists, instead of just the browser console.
+      console: window.console,
       // Make sure 'define' function exists. This allows reusing AMD modules.
       define: function(callback) {
         callback(this.require, this.exports, this.module);
         return this.exports;
       }
     }
   };