Search code examples
javascriptwindowsfirefoxhotkeysadd-on

How to call the console debug panel in a Firefox addon?


What's the Javascript function that calls the console debug panel (CTRL+SHIFT+J) on Firefox?


Solution

  • Here is how to open the console pannel

    var win = event.target.ownerDocument.defaultView;
    win.gDevToolsBrowser.selectToolCommand(win.gBrowser, "webconsole");
    

    Also possible with

    HUDConsoleUI.toggleBrowserConsole();