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 280889 9e771bb631ce8d732af7d389837aed8561ac2bf6
parent 280888 1fc5f691e48258d3f9be7f857d0a081b6a473790
child 280890 f87d296b05288411bce7a722e232e71ffe088962
push id29922
push usercbook@mozilla.com
push dateThu, 21 Jan 2016 10:51:00 +0000
treeherdermozilla-central@977d78a8dd78 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlongster
bugs1224751
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;
       }
     }
   };