Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bug 885457 - Display browser console instead of error console. r=@Mossop

  • Loading branch information...
commit 4b0c67ed4ab2c4a835524ac98816a11ab74a45fa 1 parent e494b8e
@ochameau ochameau authored
View
BIN  addons-builder-helper.xpi
Binary file not shown
View
13 lib/addons-builder-helper.js
@@ -8,6 +8,7 @@ const windowManager = Cc['@mozilla.org/appshell/window-mediator;1'].
const windowUtils = require("sdk/window/utils");
const prefService = require("sdk/preferences/service");
const { PageMod } = require("sdk/page-mod");
+const xulApp = require("sdk/system/xul-app");
const AddonInstaller = require("sdk/addon/installer");
const tmpFile = require("sdk/test/tmp-file");
@@ -21,6 +22,18 @@ const CONFIG_PREF = "extensions.addonBuilderHelper.trustedOrigins";
* Return `message` attribute sent back to the webpage.
*/
function toggleConsoleWindow(command) {
+ // Starting with FF 24, we should be displaying the browser console
+ // as all addon messages no longer prints to the Error console
+ if (xulApp.versionInRange(xulApp.platformVersion, "24.0a1", "*")) {
+ // We do not care about other commands as the website only call `open`
+ // and HUDConsoleUI only exposes toggle.
+ if (command == "open") {
+ let browserWindow = windowManager.getMostRecentWindow('navigator:browser');
+ browserWindow.HUDConsoleUI.toggleBrowserConsole();
+ }
+ return false;
+ }
+
let consoleWindow = windowManager.getMostRecentWindow('global:console');
switch(command) {
case 'open':
Please sign in to comment.
Something went wrong with that request. Please try again.