Bug 1224751 - Use the window's console in BrowserLoader. r=jlongster
authorJ. Ryan Stinnett <jryans@gmail.com>
Wed, 20 Jan 2016 12:34:44 -0600
changeset 303104 9e771bb631ce8d732af7d389837aed8561ac2bf6
parent 303103 1fc5f691e48258d3f9be7f857d0a081b6a473790
child 303105 f87d296b05288411bce7a722e232e71ffe088962
push id8978
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 14:05:32 +0000
treeherdermozilla-aurora@b9a803752a2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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;
       }
     }
   };