Embedding the Error Console in Fennec

Trying to debug problems in Fennec while running on a mobile device can be a pain. Using the JavaScript Error Console is one way you can track down problems, especially JS coding errors. Some applications, like Firefox, have a UI to launch the Error Console. Other applications don’t. You might not know this, but any Mozilla-based application automatically supports displaying and using the Error Console. Simply launch the application using the -jsconsole command line flag, and the Error Console will open.

This is all well and good on desktop devices, but some mobile devices don’t do a good job of handling multiple open windows – I’m looking at you Windows Mobile. To make it easier to view errors, we added the Error Console as a browser panel in Fennec. It’s hidden by default – you need to use about:config to display it.

  • Navigate to “about:config”
  • Set “browser.console.showInPanel” to “true”
  • Restart Fennec
  • Go to the Browser Panels to display the Error Console

It should resemble the standard Error Console. The list can be panned vertically and horizontally. The code evaluator is functional. In fact, Gavin Sharp found an easy way to mimic device window sizes when running a desktop version of Fennec. For example, enter top.resizeTo(480, 800) into the code evaluator to resize the window to match portrait mode.

3 Comments

  1. M.Saedy said,

    June 20, 2009 @ 4:38 pm

    Hi
    I’m sorry to post this comment here since it is not about this blog entry but I couldn’t find any contact info.

    So the thing I wanted to say: I have written some small but useful xul apps, would you mind if I send’em to you? I’d really like to know what you think of them.

    I know you are a busy guy, so if it’s too much to ask just say so.

    Thank you and have a wonderful life!
    M.S.

  2. about:mozilla – Firefox 3.5, add-ons contest, screencasts, hacks, multi-process, collections, art, security, and a whole lot more… | Easy Firefox said,

    June 23, 2009 @ 8:27 pm

    [...] in Fennec. It’s hidden by default — you need to use about:config to display it.” Read the rest of Mark’s post (which includes screenshots of the Fennec Error Console) at his [...]

  3. Fennec Beta 2 for Maemo and Alpha 2 for Windows Mobile at Brad’s Blog said,

    June 27, 2009 @ 9:18 pm

    [...] end changes for both platforms, which Stuart touched on with his post announcing the release. Mark posted more details about the new embedded error console. I’m really hoping he writes another post about some of the other front end improvements that [...]

RSS feed for comments on this post