A Firefox add-on that provides a simple Firefox troubleshooting API to Mozilla web sites.
JavaScript Shell
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 2 commits ahead, 3 commits behind 0c0w3:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Troubleshooter is a restartless Firefox add-on that provides a simple Firefox troubleshooting API to Mozilla web sites. Here's the entire API:

window.mozTroubleshoot.snapshotJSON(function (json) {

json contains various data describing the user's Firefox including its version, modified preferences, installed add-ons, and more; it's the same data listed on Firefox's about:support page. Its schema is defined by the SNAPSHOT_SCHEMA object here.

All pages on the following domains are blessed with mozTroubleshoot:

You can bless other domains with the environment variable TROUBLESHOOTER_ORIGIN. Set it to an origin, which is just a scheme + domain + optional port string, like "http://www.mozilla.org" and "http://www.mozilla.org:99". Use "*" to bless all domains. To bless multiple domains, put them in a space-delimited string.

Firefox 10 is the oldest supported Firefox. Some troubleshooting data is unavailable on versions older than 18. When particular data is unavailable, the value of the relevant property in the JSON-encoded object will likely be an error message.

Technical Notes

The mozTroubleshoot API is backed by the Troubleshoot.jsm API introduced in Firefox 18. The add-on includes a copy of that module so that users running older versions can use it, too, although some data will be unavailable. The copy was pulled from mozilla-central revision f3f379beb585 and was modified to remove its preprocessing directives.

The add-on logs to the terminal (via dump) and Firefox's error console (via nsIConsoleService). By default only errors are logged, but you can make the log more verbose by setting the environment variable TROUBLESHOOTER_LOG_LEVEL to an integer indicating the desired log level. 0 is the debug log level and logs everything. See src/content/logger.jsm for details.