Using the Add-on SDK’s cfx run command, is it possible to get it to log to Firebug’s console instead of the command line one from the main add-on code or content scripts?
Using the Add-on SDK’s cfx run command, is it possible to get it to
Share
You can use the undocumented property
unsafeWindow. As its name implies, this is a BAD IDEA. But, as you are only using it for debugging everything should be fine. Please remove these statements when releasing your addon.If you want to make all console calls go to firebug you can put the following in your content script.
If you just want log
Note: When I was running this on a
contentScriptWhen: "start"page-mod I noticed that Firebug hadn’t loaded into the console object yet. So if you are usingcontentScriptWhen: "start"you may need a slight delay before accessing the console.