Source code for showscreencap.xpi

The Show Screen Captures Firefox extension is just directories and 6 files zipped up. If you download the .xpi file and unzip it (using WinZip or StuffIt), you will see the file directory structure below.


+ showscreencap
  |
  +-- install.rdf
  |   installation info - an install.js file is required for compatibility below v0.9
  |
  +-+ chrome
      |
      + -- showscreencap.jar 
      |    contains the other two directories and files - only include this in final .xpi
      |
      + - skin
      |    |
      |    + - classic
      |        |
      |        + - showscreencap
      |            |
      |            + -- contents.rdf
      |
      + - content
          |
          + - showscreencap
              |
              + -- about.xul
              |    for the about dialog
              + -- contents.rdf
              |    tells the fox where everything is
              + -- showscreencapOverlay.js
              |    brains of the whole operation - it's just javascript
              + -- showscreencapOverlay.xul
                   interface bit - show in tools menu and context menu

To create the showscreencap.xpi file, zip up the directory structure and rename to a .xpi file. I used the java development kit's free jar.exe utility to zip the dir structure, like so:

C:\j2sdk1.4.1_01\bin\jar -cfM showscreencap.xpi *.*

This has to be done twice: once for the .jar in the chrome directory, then for the whole dir structure.

Once I place the .xpi file on my web server, I added the following line to my .htaccess file to get it to auto-install for Firefox users:

AddType application/x-xpinstall .xpi