Pages

Sunday, October 11, 2009

Fennec is a XUL application, like Firefox based on Mozilla Platform. Therefore, it can be debugged and modified with the Firefox debugging tools you are familiar with.

XUL applications consist of several XUL, JavaScript, and CSS files, which are archived in a Jar file. In the case of Fennec, it has two jar files in fennec/chrome/. en-US.jar which has localization information, chrome.jar which has Fennec front-end code.

To modify them,

1) Extract the chrome.jar in the current path
2) Modify the chrome.manifest as follows

In order to display variable values or simple JavaScript debug message information in the system console, you can use the dump function. Before using this command, it needs to enable browser dump preferences by typing about:config in the URL bar.

browser.dom.window.dump.enabled=true

This is an example of using dump() in the startup() funciton in browser.js

The dump function works well on Linux system, but it doesn't work in Visual Studio in Windows system in order to debug Fennec for Windows Mobile.
It works well in Visual Studio, so I could see debug messages in the output box of Visual Studio using the latest build of Fennec.