1

I'm new to both javascript and firefox extension writing so I need a really explicit answer.

I'm writing a firefox extension that will inspect and modify GET requests from the browser before the page is loaded. I need to debug my code and installed matching versions of Chromebug and Firebug (1.7.0a7).

What do I need to put into my extensions javascript code to get it to output to the chromebug log. I tried Chromebug.Console.log("message here") and Firebug.Console.log("message here") and neither output to the chromebug console.

How is logging done for firefox extensions?

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
boris_qd
  • 11
  • 1

3 Answers3

1

I have never worked with Chromebug, but you can log to Firefox's error console by using

    Application.console.log("I'm a log message");

This may help until you get Chromebug running. In addition, there's Venkman the Javascript debugger.

speedball2001
  • 947
  • 4
  • 7
  • That should be `Firebug.console.log("I'm a log message");` `Application...` doesn't work for me at least. – Peter V. Mørch Apr 27 '11 at 11:06
  • I does work for me in Firefox 4 as well as in Thunderbird. It is a published API (https://developer.mozilla.org/en/Toolkit_API/FUEL). – speedball2001 Apr 27 '11 at 17:20
  • I didn't spend any effort to research my claim, other than noticing that Application... didn't work for me in FF 3.6, but that Firebug did. Perhaps I've been premature in my comment, and for that I apologize. – Peter V. Mørch May 02 '11 at 20:40
0

I can't figure it out either. I created an issue at http://code.google.com/p/fbug/issues/detail?id=4256. Maybe vote for it there.

Note as I describe there you can get it to work by typing something in the Chromebug console.

Another alternative is to use FBTrace, but getting console figured out would be better :)

studgeek
  • 14,272
  • 6
  • 84
  • 96
0

This may have been solved. For anyone interested... As far as I can tell, after 1.7.2 console.log works just fine.

Michael Merchant
  • 1,509
  • 2
  • 17
  • 28