Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

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

0 comments on commit 4b0c67e

Please sign in to comment.
Something went wrong with that request. Please try again.