In a Firefox extension of mine, the preferences window apparently broke somewhere after Firefox 2.0, and (a part of) the problem lies in the following line:
var fontList = Components.classes["@mozilla.org/gfx/fontlist;1"].
createInstance(Components.interfaces.nsIFontList);
which errors with a
Error: Components.classes['@mozilla.org/gfx/fontlist;1'] is undefined
Some digging suggests that fontlist is in fact a wrapper around nsIFontEnumerator (https://bugzilla.mozilla.org/show_bug.cgi?id=397813) but I can't find anything on how to use nsIFontEnumerator.
Stackoverflow itself only has one question which sort of touches on the topic, which is unanswered: How to discover Font Type?