Wednesday, April 11, 2007

installed XPCOM components list

If anybody wants to list all XPCOM components installed on his/hers Mozilla platform - here is a small script. Embed it on the page and it will do the rest. It took me a pretty lng while to figure this out (I'm not very good with javascript and Mozilla), and in the end it appered to be so freaking simple!.. so maybe it will be useful for somebody like me.


Here it goes:
var numOfObjs = 0;
for (tmp in Components.classes)
{
document.write(tmp + "
");
numOfObjs++;
}
document.write("Found objects: " + numOfObjs + "
");



Same you can do for interfaces:


var numOfObjs = 0;
for (tmp in Components.interfaces)
{
document.write(tmp + "
");
numOfObjs++;
}
document.write("Found objects: " + numOfObjs + "
");



It still did not help me to get my registered class though - it appears to be not registered, but at least I see my interface..