My First Jetpack Plugin

By Deane Barker on December 28, 2009

I wrote my first Jetpack plugin for Firefox this morning.  I’m exploring the value of Jetpack (or any browser client modification, really) to ease content migrations, so I wanted to see what all the fuss was about.

To do this, I played around with something else I really wanted – the ability to copy the (1) title, (2) URL, and (3) selected text to the clipboard in one shot.  There was a Firefox extension that did this a couple years back, but it stopped development for some reason.

In the image, you can see what my plugin does – it adds “Copy Title and URL” to the right-click menu.  Highlight some text, right-click, select that option, and the document title, URL, and the selected text are formatted up and copied to the clipboard, suitable for pasting into an email.

Jetpack is crazy simple.   It took about 10 lines of Javascript in a single .js file.  You need to have another HTML file with a LINK tag pointing to the .js file.  Open the HTML file, and Firefox will ask you if you want to install the referenced Jetpack code.  Do so, and it’s instantly there, no restart.

The Javascript is easy to write because Jetpack has the full jQuery API automatically.  There are also Jetpack hooks to access the browser itself (I modified the right-click menu) and other items in the environment (I put something onto the Windows clipboard).  They also assume you have Firebug – all logging is done through that.

The implications here are pretty cool for content migration (my original point to all this).  With my 10 lines of code (and maybe a few more), I can let the user highlight some text on the page, right-click, and throw that text and URL at a Web service.  That service could then clean that code, and automatically import it to a CMS.

In the end, Jetpack fills a nice little niche between a Javascript bookmarklet and full-blown Firefox extension.  It has far more access to the environment than a bookmarklet would, but doesn’t take near the time or skill to write as an extension would.

Gadgetopia

Comments

  1. I had my own experience, converting the bookmarklet from Green Any Site to Jetpack, and it was super simple…

    But in the end, the install base for Jetpack is so tiny, it really isn’t worth the effort, nor can it replace a real plugin.

    A Jetpack -> FF addon convertor would really change everything… And it should be relatively easy to develop.

  2. I remember using a product for migrating content into MCMS years ago. It integrated with IE so you could easily import pages to an MCMS site. Sounds similar to what you are trying to build with JetPack. It was highly useful for my content team at the time as we migrated to the new CMS.

    Can’t remember the name of the company or product now, unfortunately.

Comments are closed. If you have something you really want to say, email editors@gadgetopia.com and we‘ll get it added for you.