Feb16'10

Jetpack 0.8 Released, now what’s next?

The final release of the Jetpack prototype (0.8) has landed! 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.

New APIs in Jetpack 0.8

Toolbar

You can now include simple toolbar buttons in the Firefox UI! The Toolbar API makes it easy to tie browser functionality to these buttons, have a look:

var myButton = {
  id: "fooButton",
  label: "FOO!",
  tooltip: "Click on my to do something.",
  image: "http://www.mozilla.org/favicon.ico",
  click: function(event) { console.log("FOO! has been clicked") }
}

// Append the button to the toolbar
jetpack.toolbar.navigation.append(myButton);

For further info on this API, see JEP 21.

Places

The other significant API available in this release is Places. Places is the name for history and bookmarking methods contained in Firefox. You can access Places functionality in the following ways:

function titleParse(doc) {
  let title = doc.title.split();
  for (let idx in title) {
    if (title[idx] === 'foo'){
      jetpack.places.bookmark.create({url: document.location, title: document.title, tags:['foo', 'jetpack-auto-tag']});
      break;
    }
  }

  // lets alert the user - tell them how many bookmarks we have with 'foo':
  function callback(results) {
    alert("You have " + results.count + " bookmarks where the title contains 'foo'! Very Nice!");
  }

  jetpack.places.find({where: 'bookmarks', phrase: 'foo'}, callback);
}

jetpack.tabs.onReady( titleParse );

For further info on this API, see JEP 22.

Jetpack, the next phase…

With the release of Jetpack 0.8, the prototyping of Jetpack has come to a close and our efforts are shifting toward the goal of developing a mature, production-level version of the platform. This production version of Jetpack will phase in a new security model and a more extensible architecture with code reuse and true Mozilla-style code collaboration as core tenets. Look for a technology preview in the coming weeks! To view more detailed information on this next phase of Jetpack development, please visit the Jetpack wiki section found here.

- Daniel Buchner, on behalf of the Jetpack team

About the Author

Myk Melez

Myk is a longtime Mozilla toolsmith and engineer who worked on Forumzilla, Bugzilla, and Firefox before joining labs. He loves to hack and make people happy.

More from Myk Melez »

Category

Uncategorized

About Mozilla Labs

We are a team of engineers & designers - and a community of explorers, experimenters, thinkers and creators. Together we imagine and build the future of the browser and the Web. Join us and help invent the future.

Newsletter

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