Zaphod 1.0 Released

Today we are launching Zaphod, an addon for integrating the Narcissus JavaScript engine into Firefox 4.

Narcissus is neither as fast nor as feature-rich as SpiderMonkey, BUT it is substantially easier to read, understand, and (critically) modify.  If you have a new feature idea, Narcissus is an ideal tool.  With the Zaphod addon, you can also integrate Narcissus into the browser as your JS engine in order to do some real meaningful tests.  Also, since your changes will be separate from the browser code base, you can more easily share your ideas with others.

Zaphod will process any script tag with a type of “application/narcissus” using the Narcissus engine.  Since SpiderMonkey will ignore script tags of an unknown type, it won’t interfere with Narcissus.  Also, you can specify the script type of the page as Narcissus with a meta tag:

<meta http-equiv=”Content-Script-Type” content=”application/narcissus” />

Doing so will cause Narcissus to execute the various on* listeners specified for different elements.  (Unfortunately, SpiderMonkey will also execute them, which may or may not cause issues).

However, Zaphod also provides an additional alternative.  Click on the Mozilla icon in the bottom right of your browser window, and it will disable SpiderMonkey and use Narcissus for parsing all JavaScript on any page you visit.After you are done experimenting, click on the icon again and SpiderMonkey will be reset to your JavaScript engine.

At the moment, Zaphod does not work well with the more JavaScript-heavy sites like GMail, but we have several examples available for experimentation.  Enjoy!