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.