MozNET Tutorial - Javascript XPCOM Component

EDIT: As of R18, the component created in this tutorial is no longer required for taking screen shots with MozNET but, it still has value in that it will show you how to create a Javascript based XPCom component.

This tutorial will walk you through the steps required to create and register a Javascript based XPCom component to be used with MozNet. Instead of building the normal 'Hello World' introductory tutorial I'm going to show you how to build something that can actually be useful. We're going to build a component that will allow us to take a full page screen shot of a given web site. It's not going to have a bunch of bells or whistles but, it'll be enough to get your hands dirty and at the same time build something usable.

A Good Text Editor

First thing first. We need a decent, light-weight, text editor. While Visual Studio is great for working with code files it's a bit overkill for what we're doing here. A good editor to use would be something such as Programmer's Notepad orNodepad++ or something similar. I use Programmer's Notepad, myself. It's free, light-weight, and has quite a few features. Whenever I'm working with IDL files this is my editor of choice. That being said, I'm sure you have you're own preference for text editors so feel free to use your favorite.
Let's get started...

A Component Skeleton

The second thing we need is a base, something to start building our component from. Below you'll find the skeletal block of code that we'll use as a template for building our XPCOM component.Open your favorite text editor and paste the code below into a new, empty, document. Save it as 'ExampleComponent.js'.

Not a whole lot to it, eh?
We'll, that's about as simplified as it can get actually. Now, let's do something with it.I said we were going to build something useful so let's get started. MozNet lacks a good way of grabbing a full page screen shot of a web site because the interface method provided by XulRunner cannot be used from C# (nor c++). Javascript on the other hand, can easily access the interface method we need. We're going to use this tutorial to build a component that will add the missing feature to MozNet.

Next Page
//se7en-soft.com/Default.aspx//se7en-soft.com/temporary.aspx//se7en-soft.com/FileLocker/KeyMaster.aspx//se7en-soft.com/Software/AZProductFinder/amzsetup.aspx//se7en-soft.com/Software/AZProductFinder/Default.aspx//se7en-soft.com/Software/AZProductFinder/guide.aspx//se7en-soft.com/Software/AZProductFinder/Help/Default.aspx//se7en-soft.com/Software/BatchConvertEZ/Default.aspx//se7en-soft.com/Software/IMDBAPI/Default.aspx//se7en-soft.com/Software/JackHammer/Default.aspx//se7en-soft.com/Software/MozNET/Classic.aspx//se7en-soft.com/Software/MozNET/CodeSnips.aspx//se7en-soft.com/Software/MozNET/Default.aspx//se7en-soft.com/Software/MozNET/Features.aspx//se7en-soft.com/Software/MozNET/Modern.aspx//se7en-soft.com/Software/MozNET/Tutorials/Javascript/Default.aspx//se7en-soft.com/Software/MozNET/Tutorials/Javascript/Page2.aspx//se7en-soft.com/Software/MozNET/Tutorials/Javascript/Page3.aspx//se7en-soft.com/Software/MozNET/Tutorials/Javascript/Page4.aspx//se7en-soft.com/Software/MozNET/Tutorials/ManagedCode/Default.aspx//se7en-soft.com/Software/MozNET/Tutorials/StringBundleService/Default.aspx//se7en-soft.com/Software/MozNET/Tutorials/WindowExternal/Default.aspx//se7en-soft.com/Software/MozNET/Tutorials/XPCOM/AIO/Default.aspx//se7en-soft.com/Software/MozNET/Tutorials/XPCOM/Native/Default.aspx//se7en-soft.com/Software/NoteMagic/Default.aspx//se7en-soft.com/Software/Specter/Default.aspx//se7en-soft.com/Software/SynthEV/Default.aspx//se7en-soft.com/Software/Win7Lib/Default.aspx//se7en-soft.com/Testing/SiteStyle/Default.aspx