Nov10'09

Announcing Jetpack 0.6

We are happy to announce the release of Jetpack 0.6. Jetpack is a Mozilla Labs project which makes it possible for anyone who knows standard web skills (HTML, Javascript, CSS) to make Firefox add-ons.

Jetpack 0.6 adds two major APIs to the arsenal: a secure preferences system and the ability to add and modify menus. With these new APIs — and the numerous bug fixes since the last release — we hope to see even more innovative Jetpacks in addition to the hundreds already written.

Menu

An important part of many add-ons is creating menu items — both at a system level and for context menus. In Jetpack 0.6, we’ve tried to make this painless.

Jetpack Menu API Tutorial

For example, adding an item to the Tool’s menu requires just one line of code:

jetpack.menu.add("Hello World!");

For a fully useful example, check out the Pixlr Image Editor Jetpack, which lets you edit any photo you find on the web with a right-click.

If you want to dive in, you can read the Menu API documentation.

Settings

Most Jetpacks require a couple of persistent settings, like user names, passwords, and preferences. The Settings API tries to be unobtrusive — you tell Jetpack what kind of settings you want and Jetpack takes care of the interface.

For example, include the following code for settings in your Jetpack:

var manifest = {
  settings: [
    {name:"username", type:"text", label:"Username"},
    {name:"music", type:"boolean", label:"Music", default: true },
    {name:"volume", type:"range", label:"Volume", min: 0, max: 10, default: 5 }
  ]
};

Jetpack will automatically build a UI for it:

And your Jetpack will be able to access the settings via:

jetpack.storage.settings.username
jetpack.storage.settings.music
jetpack.storage.settings.volume

This is a first iteration of a settings implementation, more will be coming soon. For more details, read the Settings API proposal document.

Download

If you already have Jetpack installed, update to 0.6 via the “Find Updates” button in the add-ons manager. If you’re new to Jetpack, you can get Jetpack automatically by installing any Jetpacks or by downloading it directly from addons.mozilla.org.

Participate

Mozilla Labs is a virtual lab where people come together online to create, experiment and play with Web innovations for the public benefit. There are many ways to join the team and get involved:

– Aza Raskin, Atul Varma, Daniel Buchner, and Nick Nguyen on behalf of the Jetpack development team.

About the Author

Pascal Finette

Pascal is the Director of Mozilla Labs and focuses on making things happen. When he's not working he usually runs long distance races (think Marathon and beyond), plays with his two Whippets and hangs out with his family. You can follow Pascal on Twitter at @pfinette or email him at pfinette [at] mozilla.com.

More from Pascal Finette »

Category

Uncategorized

About Mozilla Labs

Laboratories are where science and creativity meet to develop, research, and explore new ideas. Mozilla Labs embraces this great tradition - a virtual lab where people come together to create, experiment, and play with new Web innovations and technologies.

Newsletter

Enter your email address here to subscribe to our mailing list for announcements: