Saturday, June 23, 2007

How to use an XPCOM Component?

In the last post, I created an article on How to create a Javascript XPCOM component in 5 minutes”. To make it a little more complete, I will provide the details on how to use the XPCOM Component that you created in this post.

It turns out to be pretty simple once you have followed the instructions from the previous post. The code snippets is shown below.

try {
// this is needed to generally allow usage of components in javascript"UniversalXPConnect");

var fc = Components.classes[';1']

} catch (anError) {
LOG("ERROR: " + anError);


No comments: