Planet Jetpack BETA

May 14, 2013

Jetpack Project: weekly update for May 14, 2013

WE SHIPPED!!

Unless you’re hiding under a rock, you are probably aware that the Mozilla Project has released Firefox 21 today. Additionally, unless you’ve been completely ignoring my recent posts on this blog, you might also realize that Firefox 21 signals a new chapter in the life of the Jetpack project, as we ship the SDK’s module loader and APIs in Firefox 21.

To me this is a big deal, for add-on developers, for Firefox developers, for the entire project. I’d like to thank everyone involved for all the hard work, but in particular there are a few people who deserve special mention:

  • Atul Varma & Aza Raskin started Jetpack in 2009 in Mozilla Labs, then rebooted it in 2010, ushering in the modern era of content scripts, CommonJS modules the command-line cfx tool and Add-on Builder.
  • Dietrich Ayala, David Mason, Myk Melez & Brian Warner who guided the project through the ‘re-boot’ phase, always with an eye to landing Jetpack’s capabilities in Firefox and revolutionizing how Firefox features are made.
  • Dave Townsend, Irakli Gozalishvili and the rest of the current Jetpack team who have done a ton of work coordinating a series of important changes to make the SDK fit nicely into mozilla-central.
  • Various Mozilla Labs engineers including Shane Caraveo, Anant Narayanan, Andrew Sutherland & David Ascher who kicked the tires and built prototyped their own crazy ideas based on our shaky prototypes and beta releases.
  • Our fantastic contributors who keep showing up with great code for new features and bug fixes.

Now that we ship with Firefox I have decided to dial back the frequency of these posts to every 6 weeks on uplift and instead highlight for developers the new features and bug fixes that have landed in the recent Nightly cycle. As always if you have questions, feedback or want to get involved you can find us on the wiki, on the email list and of course in #jetpack on irc.mozilla.org.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2013-05-14 10:39:08 PDT

by Jeff Griffiths at May 14, 2013 08:26 PM

April 23, 2013

Jetpack Project: weekly update for April 23, 2013

Project News

This week I’d like to tease some of the new stuff we’re working on. We’re excited to be implementing some new APIs that allow developers to add buttons and other common UI elements to the Firefox navigation bar. Based on Matteo’s JEP, here is an example of how this would work:

const { Button } = require("sdk/button");
 
// Minimal "action" button, default icon, 16x16
let actionButton = Button({
    id: "my-button",
    label: "My Button"
});
 
actionButton.on("click", function() {
    // do something when the button is clicked
});

This work is linked to a huge effort on the part of the Firefox team to deliver a refresh of Firefox’s look and feel called ‘Australis’ in Firefox 24.

Next up, we’re also excited to bring more of the web into add-on development. Irakli and Eddy have been working on a simple way to import DOM apis and use them in your add-on. Here’s a small example to illustrate how we expect this to work:

let { window } = require("sdk/addon/window");
let exampleSocket = new window.WebSocket(
    "ws://www.example.com/socketserver", 
    ["protocolOne", "protocolTwo"]
);

If you have any feedback on this or other upcoming work, we’d love to hear from you, either in #jetpack on irc.mozilla.org or via the Jetpack mailing list.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2013-04-23 08:42:09 PDT

Meeting Brief

  • High Priority work: Last private browsing changes need to be uplifted, cross-domain content script support is landed on the platform but needs an owner for the JS side.
  • Roundtable: we’ll start flagging good first bugs in triage, dcamp had some questions about loader internals.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2013-04-23#Minutes

by Jeff Griffiths at April 23, 2013 11:30 PM

April 09, 2013

Jetpack Project: weekly update for April 09, 2013

Project News

Help out Jetpack by using Stack Overflow! You may not be aware, but one of the most common sites where people ask questions about the Add-on SDK is actually on Stackoverflow.com. Questions are marked with the [firefox-addon-sdk] tag, and several new ones appear each week. While you are there, you should also check out the many questions tagged with [firefox-addon] as well. If you’ve got questions about add-on development yourself or don’t mind helping others, Stack Overflow is a great place to contribute.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2013-04-09 08:23:50 PDT

Meeting Brief

  • we’ve landed the final work to make Panels work with per-Window private browsing, to be released in Firefox 22.
  • we’re close to landing platform support for cross-domain xhr in content scripts
  • the Firefox team dropped by to talk about collaborating on new Add-on friendly features in Australis.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2013-04-09#Minutes

by Jeff Griffiths at April 09, 2013 07:47 PM

April 02, 2013

Jetpack Project: weekly update for April 02, 2013

Project News

After last Tuesday’s release of Add-on SDK 1.14, we updated you on Wednesday about changes in console.log behaviour, and then again on Thursday once we’d updated the AMO Validator and Add-on Builder sites to correctly support SDK 1.14. The current status is that we’re tracking a bug in the AMO validator which produces two erroneous warnings from add-ons packed with SDK 1.14. We expect the validator will be updated to fix this on Thursday afternoon ( PST ).

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2013-04-02 11:39:07 PDT

Meeting Brief

  • High priority: Irakli is closing out Panels support for Fx22, cross-domain work is moving ahead, other items are on track.
  • SDK: Wes proposes new Firefox-version-centric tagging scheme for > 1.14.
  • Roundtable: dcamp is changing the devtools to use Jetpack’s loader, is looking for alternatives to his chrome url hack

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2013-04-02#Minutes

by Jeff Griffiths at April 02, 2013 07:57 PM

March 28, 2013

Add-on SDK 1.14 now available on Add-on Builder

As you probably know, Add-on SDK 1.14 was released on Tuesday. I’m pleased to also announce that Add-on Builder has been updated to support SDK 1.14. As well, the AMO Add-on Validator has also been updated to support SDK 1.14.

The one caveat with using Add-on Builder with SDK 1.14 is that the behaviour of console.log changed. If you rely on the Error Console window to view messages from console.log, you have two options:

  1. Change all calls to console.log to console.error, which will print out scary looking red messages in the Error Console’s ‘Errors’ tab
  2. Follow the instructions detailed in my blog post from yesterday to ensure that any calls in your add-on code to appear as they previously did in the ‘Messages’ tab of the Error Console window.

We’ve logged a bug to improve this experience via an update to the Add-on Builder Helper add-on so this will not be an issue in the future.

by Jeff Griffiths at March 28, 2013 10:56 PM

March 27, 2013

Changes to console.log behaviour in SDK 1.14

One change in SDK 1.14 that has already surprised some people in the community is a change in the visibility of messages printed from console.log.

In 1.14 we added some additional features to the console API and also set the default log level to “error” instead of “info” for add-ons installed into Firefox via the Add-on Manager and Add-on Builder Helper as well as tools like the Extension Auto-installer.

An unfortunate side-effect is that by default, developers using these tools will no longer see messages from console.log() in the jsconsole window.

We have provided the ability for developers to set preferences to control logging behavior both globally and for a specific add-on, and by setting one of these preferences you can override the default.

Logging levels

The console module now defines a range of logging levels:

  1. all: log calls to any console method
  2. debug: log calls to debug(), log(), info(), warn(), error()
  3. info: log calls to log(), info(), warn(), error()
  4. warn: log calls to warn() and error()
  5. error: log calls to error()
  6. off: log nothing

New Preferences

We have defined two new preferences, which set the logging level either globally for all SDK add-ons, or for a specific SDK add-on:

extensions.sdk.console.logLevel: this preference can be added to about:config to change the logging level of all installed SDK-based add-ons.

extensions.[extension-id].sdk.console.logLevel: this preference can be added to about:config to change the logging level of a specific add-on. This preference overrides the global preference.

The value for each preference is the desired logging level, given as a string. If neither preference is set, the logging level defaults to “error”.

Restoring the old behavior

If you want to restore the previous behavior in which console.log messages are visible in the error log, please do the following:

  1. open about:config
  2. right-click and select New -> String
  3. for the preference name, enter ‘extensions.sdk.console.logLevel’
  4. for the preference value, enter ‘all’
  5. restart Firefox

Here is a screenshot of what the result should look like:

about_config

by Jeff Griffiths at March 27, 2013 11:11 PM

Jetpack Project: weekly update for March 26, 2013

Project News

The Jetpack team released Add-on SDK 1.14 a few hours ago! This is a huge step on our journey towards integrating Jetpack with Firefox.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2013-03-26 09:31:12 PDT

Meeting Brief

  • High Priority work: need to scope further PWPB work, gabor has nearly landed cross-domain content script support, panel positioning looks good to land this week, and discussion of next quarters batch of high-priority work.
  • SDK: we’re shipping software, also the tree is orange! On different branches, thankfully.
  • Roundtable: discussion on how to handle target releases for cfx vs the SDK apis now that we’ve landed. Looks like we should create a ‘cfx’ bug component.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2013-03-26#Minutes

by Jeff Griffiths at March 27, 2013 01:33 AM

March 26, 2013

Announcing Add-on SDK 1.14!

I’m terribly pleased to announce the release of Add-on SDK 1.14! You can download the SDK directly in either zip or tarball format.

As I’ve written previously, SDK 1.14 will be the last release of the SDK to include the SDK APIs. Once Firefox 21 ships the version of Firefox you are using will always have the latest and greatest version of the SDK apis. What is more, add-ons packed with Add-on SDK 1.14 will always prefer the APIs embedded in Firefox if they exist, providing a forward-compatibility benefit to developers.

We are working to update Add-on Builder and the Add-on validator on AMO within the next couple of days so that they properly support 1.14. I’ll update the mailing list and twitter once this work has been completed.

What’s new?

  • Initial support for Per-window Private Browsing. Firefox 20 replaces the existing private browsing ‘mode’ with an new feature that allows users to open private windows. A significant amount of work has been done to make this work for SDK-based add-ons.
  • Unique tab ids on both Android and Desktop Firefox, for easier tracking of specific tabs.

You’ll find much more detail about SDK 1.14 in the release notes.

Some interesting stats about this release ( from the Github history between the 1.13.2 & 1.14 tags ):

  • 329 changes in 117 pull requests between tags 1.13.2 and 1.14
  • Special thanks to our community contributors Brett Zamir, Cykesiopka, Dan Stevens, Dương, H. Nguyễn, Gregg Lind, Marc Chevrier and slash_at_ac.auone-net.jp

As always, we’d love to hear from you about your experiences with this release. You can contact us in a variety of ways:

post to our discussion group
chat with us on irc.mozilla.org #jetpack
report a bug
check out the source and contribute bug fixes, enhancements, or documentation

For more information on the Jetpack Project check out our wiki.

by Jeff Griffiths at March 26, 2013 10:25 PM

March 20, 2013

Jetpack Project: weekly update for March 19, 2013

Project News

  • We are releasing SDK 1.14rc2 tomorrow, which will also likely be tagged tomorrow as the 1.14 release candidate. In addition to this we are coordinating with the Firefox team and release-drivers to ensure that the code in 1.14 is exactly the same as what we will release in Firefox 21. If you’re maintaining an SDK-based add-on, please help and test your code with ths new RC!
  • Last week’s work week in Sunnyvale yielded all sorts of amazing work, look for a post over on hacks.mozilla.org tomorrow for the full details.
  • Eddy blogged yesterday about his work on getting Firefox’s Browser Debugger working with SDK-based add-ons.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2013-03-19 09:20:18 PDT

Meeting Brief

  • PWPB support is complete, but 1.14 & Firefox 21 will ship with only partial support for Add-ons that opt in to work in Private Browsing mode.
  • Cross-domain capabilities and Panel Positioning changes are close to landing, SDK 1.14 re-packs are on track, and we need to re-evaluate high-priority items as we move into Q2.
  • SDK: 1.14 RC1 was released today – test! test!
  • Roundtable: discussion on prioritizing deep integrators over work targeted at casual add-on developers.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2013-03-19#Minutes

by Jeff Griffiths at March 20, 2013 01:16 AM

March 05, 2013

Jetpack Project: weekly update for March 05, 2013

Project News

  • The entire developer tools team ( including the Jetpack team! ) will be meeting up in California next week to work together and hack on new ideas. As such, there will be no weekly meeting next week.
  • Jetpack Bugmaster Wes Kocher released a module called ‘bmo.js’ that allows SDK developers simple access to the bugzilla api.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2013-03-05 09:03:12 PST

Meeting Brief

  • High Priority: PWPB has lots of pull requests in review, need to focus on Panel work. Need to hash out Panel Positioning design next week in person, Gabor hopes to land cross-domain content script capabilities in Firefox 22.
  • SDK: tests getting flakier, help!
  • Roundtable: GSOC ideas, bmo.js, windowless docshells, debugging support!

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2013-03-05#Minutes

by Jeff Griffiths at March 05, 2013 07:44 PM

February 27, 2013

Per-window private browsing and the Add-on SDK

Update to the update!

We’ve now figured out that we only need to repack add-ons that actually use the private-browsing module.

  • If you don’t use private-browsing, you don’t need to do anything.
  • If you use the private-browsing module in an add-on that’s hosted on AMO, then it will be marked incompatible with Firefox 20, and will need to be repacked with SDK 1.14 when SDK 1.14 is released. We will repack it with SDK 1.14 if we can, and you will need to repack it yourself if you can’t. We will email you to let you know whether you need to do anything within a couple of days of releasing 1.14.
  • if you use the private-browsing module in an add-on that’s not hosted on AMO: then you will need to repack it with SDK 1.14, or it will start leaking your users’ private data from Firefox 20 onwards.

Update: since the original version of this post, we’ve decided to make repacking with SDK 1.14 mandatory. Add-ons which are not repacked with SDK 1.14 will be marked as incompatible with Firefox 20.

We’re running a project to automatically repack as many AMO-hosted SDK add-ons as we can. AMO-hosted SDK add-ons that we can’t repack, and SDK add-ons not hosted on AMO, will need to be repacked by their authors once SDK 1.14 is release on March 26.

We’ll have another blog post outlining the repacking plan soon.


 

Firefox 20 introduces major changes to the “private browsing” feature, which will affect add-ons developed using the SDK. This blog post explains what the change is, how the SDK is handling it, and what add-on developers will need to do as a result. In summary:

  • if your add-on uses the private-browsing API, you must repack it when SDK 1.14 is released on March 26th if you want your add-on to work properly on Firefox 20.
  • whether or not your add-on uses the private-browsing API, you must update it if you want your add-on to be able to see private windows on Firefox 20.

What’s per-window private browsing?

Up to and including Firefox 19, private browsing has been a global property for the entire browser. When the user enters private browsing, the existing browsing session is suspended and a new blank window opens. This window is private, as are any other windows opened until the user chooses to exit private browsing, at which point all private windows are closed and the user is returned to the original non-private session.

Firefox 20 introduces per-window private browsing. This means that private browsing status is a property of an individual window. The user enters private browsing by opening a new private window. When they do this, any existing non-private windows are kept open, so the user will typically have both private and non-private windows open at the same time.

How does the SDK handle this change?

Under the old, global, private browsing model, add-ons can handle private browsing as a simple binary condition: while private browsing is active, don’t store any user data. The SDK’s private-browsing API supports this by offering an isActive property to check whether the browser is in private browsing mode, alongside start and stop events to be notified when private browsing starts and stops.

Here’s an add-on that stores the titles of tabs the user loads, unless the browser is in private browsing mode:

var simpleStorage = require("simple-storage");
 
if (!simpleStorage.storage.titles)
  simpleStorage.storage.titles = [];
 
require("tabs").on("ready", function(tab) {
  if (!require("private-browsing").isActive) {
    console.log("storing...");
    simpleStorage.storage.titles.push(tab.title);
  }
  else {
    console.log("not storing, private data");
  }
});

The first SDK release to target Firefox 20 is SDK 1.14. This release updates the API to support per-window private browsing, and makes another important change: by default, SDK 1.14-based add-ons won’t see any private windows.

Repacking your add-on

Hiding private windows by default means that add-ons developers don’t need to update their code in order to respect per-window private browsing: all they need to do is repack their add-ons using SDK 1.14. The old API will log deprecation warnings, but will behave as if the user never enters private browsing:

  • isActive will always be false, and start and stop will never be triggered.
  • the add-on will never see private windows, or objects such as tabs that are associated with private windows
  • page-mods will not be matched for private windows

You must repack your add-on though! If you don’t, it may not function correctly, and will leak user private data, because private windows will not be hidden. We’re working on a plan to help add-on developers repack add-ons with 1.14.

Updating your code

If you want to see private windows, you’ll need to set the following key in your “package.json”
file:

"permissions": {"private-browsing": true}

Once you do that, you’ll see private windows, so if you store user data, you’ll need to use the new API to respect private browsing.

SDK 1.14 replaces the existing API with a new function isPrivate() that takes an object – a window, tab, or worker – as a parameter, and returns true if the object is a private window or is associated with a private window. So to update the add-on above, we could do something like this:

var simpleStorage = require("simple-storage");
 
if (!simpleStorage.storage.titles)
  simpleStorage.storage.titles = [];
 
require("tabs").on("ready", function(tab) {
  if (!require("private-browsing").isPrivate(tab)) {
    console.log("storing...");
    simpleStorage.storage.titles.push(tab.title);
  }
  else {
    console.log("not storing, private data");
    // do something else...
  }
});

Working with Firefox 19

SDK 1.14 bridges the gap between the old global private browsing, in Firefox 19, and the new per-window private browsing, in Firefox 20.

Since SDK 1.14 needs to support both versions, the new private-browsing API is designed to work with global private browsing. When running on Firefox 19, isPrivate() will return true if and only if the user has global private browsing enabled.

Summary

If you have an add-on built with an earlier version of the SDK, this section summarises your options when SDK 1.14 comes out.

If you do nothing

  • on Firefox 19 your add-on will continue to work fine: it will get results for isActive, start, and stop that track global private browsing, and you will be able to use them to avoid storing user private data.
  • on Firefox 20 your add-on might not work at all. If it does, it will see private windows, but the old private-browsing API will not ever tell you that they are private, so you may leak user private data.

If you repack with SDK 1.14

If you just repack your add-on but leave the code unchanged:

  • on Firefox 19 your add-on will continue to work as before: it will get results for isActive, start, and stop that track global private browsing, and you will be able to use them to avoid storing user private data.
  • on Firefox 20 any of the old private-browsing functions (isActive, start, and stop) will log deprecation warnings. Your add-on won’t see any private windows or objects, such as tabs, that are associated with them (it will behave as if these windows just don’t exist). isActive will always be false, and start and stop will never fire.

If you update your add-on

If you update your add-on, by setting the “private-browsing” flag, and updating your code to use the new isPrivate() API:

  • on Firefox 19 your add-on will work fine: isPrivate() will map on to global private browsing by returning true if and only if the user is in global private browsing mode.
  • on Firefox 20 you’ll see private windows, and isPrivate() will tell you whether it’s OK to store user data associated with windows, tabs, and workers.

by wbamberg at February 27, 2013 05:17 AM

February 26, 2013

Jetpack Project: weekly update for February 26, 2013

Project News

  • Over the last couple of days I’ve published a couple of posts about the near future of the project as we land the SDK’s apis in Firefox: [part 1] & [part 2]. If you have any feedback on these posts, please comment there, below, or ideally post to the Google group.
  • We took a hard look at the work we need to ship in SDK 1.14 and decided that, given there is also a team work week coming up the best thing to do is to delay release by 2 weeks. This means that Add-on SDK 1.14 will be released on Tuesday, March 26th.
  • Mozillian / Hacker Blake Winton created Whimsy ( code here ), a crazy little Jetpack that adds fun, zany stuff to Firefox, in particular the newtab page.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate, please comment below. Stats generated at 2013-02-26 10:08:05 PST

Meeting Brief

  • High priority work: Jetpack has landed! PWPB needs your help, ask Erik!
  • SDK: 1.14 has been pushed back a couple weeks to catch all the changes needed, and allow for team meetup travel.
  • Roundtable: discussion around squashing commits in to understandable chunks, Eddy’s blog posts, and what to expect for the work week.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2013-02-26#Minutes

by Jeff Griffiths at February 26, 2013 08:53 PM

Jetpack: The Road Ahead ( Part 2 )

In my last post I talked about the process currently underway to shift SDK development to match the Firefox release schedule. This work has taken up a ton of time over the last year or so, but most of the benefits to add-on developers are around unexciting things like compatibility and maintenance. Developers want new exciting capabilities, and thankfully we have a few plans up our sleeve.

The next phase ( Firefox 23 & Up )

Shipping in Firefox does not mean that the SDK is ‘done’; quite the opposite! The team still needs to maintain the SDK’s APIs with future versions of Firefox. As I mentioned in my previous post we do expect this work will be simplified because we will no longer need to support a range of Firefox versions with the same code-base.

What are we going to do with all this spare time? I’m glad you asked! There are three key initiatives that I mentioned in our Roadmap that are top priorities for Jetpack in 2013:

Simple, Powerful Firefox UI integration

Based on Stephen Shorlander’s excellent mockups, we will be implementing a set of high-level, useful APIs that allow developers to integrate custom UI into Firefox navigation bar in a reliable an efficient way. There will be no markup, no need to manually handle unload. These APIs will be available to all add-on developers, not just those using the SDK.

Rapid Prototyping of Firefox features

One of the goals of the SDK has always been to help make Firefox feature development easier. We’ve come a long way towards helping this by embedding our powerful, module APIs and CommonJS loader into Firefox, but we think we can go even farther by easing the pain for not only creating feature prototypes but also shipping the tried and tested code-base the prototype becomes in Firefox all using a modern, modular approach.

Awesome tools for Add-on Developers

A key goal for the team is to help improve the developer experience for add-on developers. We believe the best way to approach this problem is to create great native tools that leverage the work of the already fantastic Firefox Developer tools and provide add-on developers with the features they’ve been asking for, such as debugging, rapid prototyping and in-browser packaging.

A related goal for the team is to continue to support Add-on Builder as we move through this transition. Next week I will publish a road-map for Add-on Builder that provides more detail about Builder’s future.

by Jeff Griffiths at February 26, 2013 03:00 PM

February 23, 2013

Jetpack: The Road Ahead

Until now the SDK has been released every 6 weeks, 3 weeks offset from Firefox releases. We are breaking this established release schedule and switching to release the SDK’s APIs in Firefox itself, starting with Firefox 21. The process will be somewhat disruptive, in fact I’ve taken to calling it our awkward phase. I’d like to first describe how this awkwardness might affect you, and then why we think this transition is worth all this trouble.

The Awkward Phase

By the time we reach the end of this ‘awkward phase’ we should have a much better story for packaging and Firefox compatibility: the SDK’s apis will be maintained in our github repo, shipped with Firefox every 6 weeks, and add-ons that use these apis will no longer need to include a version of the SDK’s apis in the add-on package.

In order to achieve these goals we have decided to make Add-on SDK 1.14 the last release of the SDK that will include the APIs. Firefox 21 will be the first version that includes the SDK APIs and they will match those shipped in SDK 1.14. After we ship SDK 1.14 on March 12 we will only release new SDK API features via Firefox, meaning the next time we introduce new SDK functionality will be with the release of Firefox 22.

SDK 1.14 also introduces some changes to how add-ons load SDK APIs. If you package your add-on using SDK 1.14, the resulting xpi will by default include all of the API dependencies needed to run the add-on as usual. If your add-on is run in Firefox 21 or greater, the SDK’s loader will not load these packaged APIs, and will instead use the ones shipped with Firefox.

The Benefits

The shift to shipping in Firefox has clear benefits:

  1. developers will not need to re-pack their add-ons after SDK 1.14 in order to benefit from changes in the SDK, as the add-on will always use the APIs provided by newer versions of Firefox.

  2. the Jetpack team will decouple our releases of the cfx packaging tool from the 6 week train model. This tool should not need to change significantly so we should only need to update it on an as-needed basis.

  3. the Jetpack team will no longer need to maintain compatibility with a range of Firefox versions in a single code-base. This aspect alone will greatly reduce the complexity of our code in some areas, and allow us to more easily react to major platform changes.

  4. new features can be added to the SDK more quickly when they depend on changes to Firefox as the new features can ship in the same release as those changes rather than waiting for later.

  5. Firefox developers will be able to rely on the SDK APIs when creating new Firefox features.

What’s next?

Once Firefox 22 as been released, we will release a new cfx packaging tool; this version will not include the SDK’s APIs, and therefore will not include these APIs in the add-ons it packages. Add-ons will be much smaller, and developers will no longer need to re-pack to the latest version in order to benefit from the latest bug fixes.

What I’m most excited are the cool projects the team will start working on for Firefox 22 and up – I’ll publish a follow-up post on these plans tomorrow.

by Jeff Griffiths at February 23, 2013 03:00 PM

February 19, 2013

Jetpack Project: weekly update for February 19, 2013

Project News

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2013-02-19 09:32:31 PST

Meeting Brief

  • High Priority Items: loader & cfx items are done and landing soon, PWPB support coming in the next week or so, patches underway for x-domain content scripts, and Matteo is waiting for comments on the Panel Positioning proposal!
  • SDK: 1.14 is getting a version compatibility bump today with the release of FX 19.
  • Roundtable: need to land fix for bug 842486, some discussion of how to treat XUL content & and devtools-related content script questions.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2013-02-19#Minutes

by Jeff Griffiths at February 19, 2013 08:41 PM

February 13, 2013

Jetpack Project: weekly update for February 12, 2013

Project News

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2013-02-12 09:06:45 PST

Meeting Brief

  • High Priority work: apis are landed, working on Py CFX & loader patches to support the new layout, patched and shipped a Memshrink bug and still slugging away at the rest of the list.
  • SDK: shipping 1.13.2 later today, as well as 1.14b2.
  • Roundtable: possible weirdness on tpbl due to the Fedora -> Ubuntu switch, looking into getting Fennec tests running as well as an alternative to unsafeWindow, and looking for creative ideas for GSOC projects.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2013-02-12#Minutes

by Jeff Griffiths at February 13, 2013 01:30 AM

February 12, 2013

Announcing Add-on SDK 1.13.2

The Jetpack team would like to announce the immediate availability of SDK 1.13.2, which addresses several issues, including a P1 Memshrink bug:

  • Opening and closing browser windows seems to add FragmentOrElement objects to the CC graph when Addon SDK addons are installed which add an addonbar widget. (Bug 833783)
  • Context-menu reuses the same worker when a page navigates to a new location (Bug 839271)
  • Context-menu overflows depending on the total number of menu items regardless of whether they are hidden or not. (Bug 839318)
  • Context-menu overflow menu can become completely hidden. (Bug 839321)
  • Returning undefined from a context listener in a contentScript should hide the menu. (Bug 839814)
  • Context-menu doesn’t emit “click” event. (Bug 839872)

You can download the SDK directly in either zip or tarball format. As well, Addon-SDK SDK 1.13.2 support will be added to the Add-on Builder and the AMO Validator in the next day or so.

As always, we’d love to hear from you about your experiences with this release. You can contact us in a variety of ways:

post to our discussion group
chat with us on irc.mozilla.org #jetpack
report a bug
check out the source and contribute bug fixes, enhancements, or documentation

For more information on the Jetpack Project check out our wiki.

by Jeff Griffiths at February 12, 2013 11:29 PM

February 01, 2013

The Add-on SDK: coming soon to Firefox 21

I thought I’d shamelessly quote and link to an exciting post by Dave Townsend ( aka Mossop ) who is the engineering manager for the Jetpack team:

We’re now a big step closer to shipping the SDK APIs with Firefox and other apps, we’ve uplifted the SDK code from our git repository to mozilla-inbound and assuming it sticks we will be on the trains for releasing. We’ll be doing weekly uplifts to keep the code in mozilla-central current.

The Add-on SDK is now in Firefox! ( oxymoronical.com )

So what did we actually do? Well, over the last few months we have made a few changes to the SDK to make it fit better into Mozilla’s mercurial repository, to run tests the way our IT and QA teams expect, and to ensure that the SDK’s apis can be used in any add-on code. We’ve been doing a lot of this integration work on the ‘larch’ branch, and today Dave merged from larch to mozilla-inbound. If all goes well in a little under 3 weeks this code will get uplifted to the Aurora channel, and 3 weeks after that the same code-base will get released as Add-on SDK 1.14, the last release of the SDK that will include the APIs.

I will post a more detailed plan of what the process will be as we transition to shipping the APIs in Firefox and decouple our docs and tool releases from the train model. In the meantime, I’d like to thank the entire community who have contributed to Jetpack over the years for their support, bugs, patience and code.

Cheers!

by Jeff Griffiths at February 01, 2013 10:45 PM

January 31, 2013

Announcing Add-on SDK 1.13.1

The Jetpack team would like to announce the immediate availability of SDK 1.13.1, which addresses several issues:

  • Reverted context menu items in sub-menus to display by default as they did in 1.12 ( bug 836318 )
  • Fixed an issue where certain combinations of add-ons could result in an extra separator in the context menu ( bug 832401 )
  • Fixed a logged error from the selection module ( bug 834754 )
  • Fixed the simple-storage and other modules when run against Firefox 21 ( bug 836061 )

I would like to personally thank Izydor for reporting bug 836318 to the mailing list yesterday – we really appreciate user feedback.

You can download the SDK directly in either zip or tarball format. Addon-SDK SDK 1.13.1 is also now live on Add-on Builder, and the AMO validator should support this new version later this afternoon.

As always, we’d love to hear from you about your experiences with this release. You can contact us in a variety of ways:

post to our discussion group
chat with us on irc.mozilla.org #jetpack
report a bug
check out the source and contribute bug fixes, enhancements, or documentation

For more information on the Jetpack Project check out our wiki.

by Jeff Griffiths at January 31, 2013 08:10 PM

January 30, 2013

Per-Window Private Browsing and the SDK

Erik Vold has been working hard to implement support for Per-Window Private Browsing in the SDK, and he posted a summary of the work and how it will impact add-on authors yesterday:

To put the change simply, before with global private browsing a add-on developer need only know if the mode was active or not and when that state changed, now with per-window private browsing none of that information is available because it no longer exists.

With per-window private browsing a add-on developer will need to know if the information they are handling came from a private-browsing window and either ignore it, handle it sensitively, and possibly do some extra cleanup work for the sensitive data when the associated window is closed, or when the last private browsing window is closed. The best approach to take depends on the use case.

If you are maintaining an SDK-based add-on, here is our best advice in order to ensure that your add-on keeps working as expected over the next couple of Firefox versions:

  1. Re-pack your existing add-on to SDK 1.13, released yesterday and re-submit it to AMO. This will immunize you from an upcoming change in Firefox 21 that will remove the oldd Global Private browsing service completely. Unless you take this initial step, users will not be able to use your add-on with Firefox 21.
  2. Once SDK 1.14 is released on March 12th, re-pack your add-on again to SDK 1.14. This will allow you to specify whether your add-on will be active in Private Browsing windows, and the default will be ‘inactive’.

The SDK team will be working with AMO to mitigate the impact of these changes in a number of ways:

  • We will be reaching out to the community via posts like this and encouraging people to re-pack their add-ons.
  • We will continue to identify add-ons on AMO that use very old and/or dangerous add-ons and marking them incompatible with newer versions of Firefox.
  • We will be re-visiting our re-packing scripts that can potentially re-pack large numbers of simple add-ons. I’ll report back in a few weeks with the specifics of this work.

Comments are disabled for this post – I’ve posted a thread to the Jetpack Google group – if you have concerns or comments regarding these changes I encourage you to post there:

https://groups.google.com/d/msg/mozilla-labs-jetpack/5aJhHXzodpM/6B_9kU2UAG4J

by Jeff Griffiths at January 30, 2013 09:29 PM

Jetpack Project: weekly update for January 29, 2013

Project News

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2013-01-29 09:48:05 PST

Meeting Brief

  • High Priority items: making good progress on most issues, need to re-visit the priority of ‘Cfx.js in add-on builder’.
  • SDK: coordinating last items on the 1.13 release checklist today, need to re-visit re-packing.
  • Roundtable: confusion on a missing change, last call for items in the release notes.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2013-01-29#Minutes

by Jeff Griffiths at January 30, 2013 02:35 AM

Announcing Add-on SDK 1.13

I’m pleased to announce that we have released SDK 1.13 today! You can download the SDK directly in either zip or tarball format. As well, Add-on SDK 1.13 is now live and available for Add-on Builder users.

What’s new?

  • Dave Townsend completely re-wrote the context-menu module to be much more reliable and less prone to memory leaks, without API or behaviour changes.
  • Tab objects now have a unique id property Update: this change did not make it into 1.13, but is available for testing on our stabilization branch.
  • Thanks to contributor Siavash for adding translation credits support so that add-on translators get the props they deserve.

You can much more detail about SDK 1.13 in the release notes.

Some interesting stats about this release ( from the github history between the 1.12 & 1.13 tags ):

  • 133 changes in 35 pull requests between tags 1.12 and 1.13
  • Thanks to Siavash for their contribution!

As always, we’d love to hear from you about your experiences with this release. You can contact us in a variety of ways:

post to our discussion group
chat with us on irc.mozilla.org #jetpack
report a bug
check out the source and contribute bug fixes, enhancements, or documentation

For more information on the Jetpack Project check out our wiki.

by Jeff Griffiths at January 30, 2013 12:24 AM

January 25, 2013

Changes to “require()” syntax

In version 1.12 we changed the structure of the SDK, removing the idea of “packages” and relocating all the SDK’s modules under the “lib” directory. This changed, and greatly simplified, the require() syntax used to import modules.

This change would break backwards compatibility, so we implemented a shim to ensure that most common usages of require() would be unaffected by the change. Even so, it’s important to update to the new form when you can, and to use the new form for new code.

What’s require()?

With the SDK, you import objects from other modules using the require() statement. This is how you use modules supplied by the SDK itself, like page-mod and panel, and how you use modules supplied by the wider community, like menuitems and toolbarbuttons. You can also structure your own code into separate modules, then use require() to import objects from these local modules.

The require() statement takes a single argument, which tells the SDK which module you need. In version 1.12, we changed the way the SDK interprets this argument.

How did require() work before?

Before version 1.12 of the SDK, the algorithm used to find modules was based on the idea of “packages”. A package is a collection of modules. Most of the modules in the SDK belonged to either the addon-kit or the api-utils packages. An add-on was itself a package, and community-developed modules like menuitems were delivered in packages of their own. A package declares a dependency on another packages, if it wants to use modules from that package.

The module search algorithm was pretty complicated, but in its most basic form: the SDK would build a list of packages, always starting with the package that contained the module doing the require() and followed by the dependencies of that package. The SDK would treat the argument to require() as a path to a module file, and would search all packages in its list for a matching file, starting at the package’s “lib” directory.

So if an add-on called “my-addon” declares one additional dependency, on the “menuitems” package, it would have four packages in its search list:

["my-addon", "addon-kit", "api-utils", "menuitems"]

If a module in “my-addon” contains a require statement like:

require("some-module");

The SDK will search the following paths in order:

my-addon/lib/some-module.js
addon-kit/lib/some-module.js
api-utils/lib/some-module.js
menuitems/lib/some-module.js

This means that add-ons can import modules from all four packages using only the module name as an argument:

require("my-local-module"); // load from my-addon
require("panel");           // load from addon-kit
require("match-pattern");   // load from api-utils
require("menuitems");       // load from menuitems

This seems like a nice feature, but it’s tricky, because you can’t tell just from looking at a require() statement which module will be imported. If module names clash, unexpected modules might be imported.

How does require() work now?

In version 1.12 of the SDK we removed the concept of “packages”. All SDK modules were relocated under a new “lib” directory directly under the SDK root. Along with this, a much simpler algorithm for importing from modules was implemented:

  • to import objects from SDK modules, specify the full path to the module starting from, but not including, the “lib” directory:

require("sdk/panel");
require("sdk/page-mod/match-pattern");
  • to import objects from modules in your add-on, specify a path relative to the importing module:

require("./my-module");
require("./subdirectory/another-module");

Obviously, this change would break every SDK add-on in existence. To prevent this we added a file, “mapping.json”, which maps old-style require() statements to their new counterparts. For example:

"panel": "sdk/panel"

With this in place, most users of the SDK are unaffected by the change.

Although “mapping.json” means existing add-ons will still work without needing an update, it’s important to update your code to the new style when you can, and to use the new style in future. For one thing, any new modules we add, like IndexedDB, won’t be added to “mappings.json”, so you’ll have to use the new style if you want to use these modules.

Community-developed modules

Eventually, you’ll be able to import objects from modules outside the SDK by passing a URL to require(), but we don’t support that, yet. In the meantime there are two alternative approaches:

  • you can still use third-party packages, copying them into the “packages” directory under the SDK root and declaring your dependency on them, as the SDK tutorial outlines.
  • you can copy the modules you need to use (and any additional modules that these modules require()) into your add-on, and treat them as local modules, using relative paths in require(). But if you do this you may need to rewrite any require() statements inside these modules to be in line with the new form.

by wbamberg at January 25, 2013 09:05 PM

January 23, 2013

isolate.js via AST analysis

In the Add-on SDK we have a problem that is both annoying and confusing for a lot of our users. The problem is not SDK-specific though and maybe interesting for anyone dealing with JS in concurrent execution contexts.

Problem overview

The Add-on SDK was designed to be compatible with browser architecture where chrome and content may be in a separate isolated processes. This imposes a lot of limitations on how add-on code can interact with a page / tab content, and the lack of concurrency constructs in Javascript make this problem a lot more irritating. In the SDK we ended up implementing an API that closely resembles web workers. The main add-on code can execute content scripts in a page context that acts like a worker and interaction between add-on and content scripts happen through a message passing (for more details please take a look at content script documention)

We quickly discovered that not a lot of people are comfortable with message passing APIs, but even putting that aside it’s really annoying to be creating separate content script files for a few lines of code (most of the add-ons have content scripts that consist of few lines of code, unless accompanied with external js libraries like jQuery):

#!env/javascript
var pageMod = require("sdk/page-mod")

var mod = new pageMod.PageMod({
  include: ["*.co.uk"],
  contentScriptFile: require("self").data.url("./my.js")
}))

As an option we also allow passing content scripts in form of JS string, which is far from ideal:

#!env/javascript
var pageMod = require("page-mod")

pageMod.add(new pageMod.PageMod({
  include: ["*.co.uk"],
  contentScript: "document.body.innerHTML = " +
             	 "'<h1>this page has been eaten</h1>'"
}))

What you would actully want is to just write a function that will be executed in the context of the content. Unfortunately it’s not just matter of serialising function and then evaluating it in the context, since functions can access bindings from the outer scopes.

Idea

If we could prove that function does not refers to anything but arguments passed to it or definitions with in it, it would be pretty safe to transplant it into completely different execution context:

#!env/javascript
var pageMod = require("sdk/page-mod")

var mod = new pageMod.PageMod({
  include: ["*.co.uk"],
  contentScript: isolate(function() {
    document.body.innerHTML = "<h1>this page has been eaten</h1>"
}))

As a matter of fact such isolate function can be implemented relatively easy, all it has to do is serialise given function, parse it, perform static analyzes to verify no outer references are made and return some wrapping of source back. If given function does have prohibited references then throw TypeError back.

Code

With a great projects like Esprima, Acorn parsing JS is no-brainer. Also for SDK we could / should just use Spidermonkey parser API, but since all of them produce de facto standad AST format we can swap parsers as we pleased. So the only remaining chunk of work was static analysis. I made few micro-libraries solving very specific problems.

interset

While playing with AST I quickly discovered the need for binary operations for logical sets. So I end up writing interset small library for doing exactly that:

#!env/javascript
var union = require("interset/union")

union([1, 2], [2, 3], [3, 4])
// => [1, 2, 3, 4]

var intersection = require("interset/intersection")
intersection([1, 2], [2, 3])
// => [2]

var difference = require("interset/difference")
difference([1, 2, 3], [1], [1, 4], [3])
// => [2]

episcope

ECMAScript scope analyzer. This Library provides set of functions that perform analyzes on the nodes of the AST in the de facto AST format. All the API function take AST nodes denoting a lexical scope and performed static analyzes at the given scope level (Note: examples use esprima but library does not really cares about it and expects AST format implemented by all popular JS parsers):

#!env/javascript
var esprima = require("esprima")
var references = require("episcope/references")

var ast = esprima.parse("console.log('>>>', error)")
references(ast)
// =>  [{ type: "Identifier", name: "console" }, { type: "Identifier", name: "error" }]

var bindings = require("episcope/bindings")
var ast = esprima.parse("function foo(a, b) { var c = a + b; return c * c }")
ast.body[0].id
// => { type: 'Identifier', name: 'foo' }
bindings(ast.body[0])
// =>  [ { type: 'Identifier', name: 'a' },
//       { type: 'Identifier', name: 'b' },
//       { type: 'Identifier', name: 'c' } ]

var scopes = require("episcope/scopes")
var ast = esprima.parse(String(function root() {
  function nested() { /***/ }
  try { /***/ } catch(error) { /***/ }
}))
scopes(ast.body[0])
// => [
//  { 
//    type: 'FunctionDeclaration',
//    id: { type: 'Identifier', name: 'nested' },
//    // ...
//  },
//  {
//    type: 'CatchClause',
//    param: { type: 'Identifier', name: 'error' },
//    body: { type: 'BlockStatement', body: [] }
//  }
//]

isoscope

ECMAScript function isolation analyzer. This is very alpha, but intention is to provide API for performing static analyzes on the JS AST nodes denoting a function definition / declaration and perform analyzes to gather info about their isolation:

#!env/javascript
var esprima = require("esprima")
var enclosed = require("isoscope/enclosed")

// Parse some code
var form = esprima.parse(String(function fn(a, b) {
  console.log(String(a) + b)
}))

// Get a function form we'll be analyzing
var fn = form.body[0]
fn.id
// => { type: "Identifier", name: "fn" }

// Get names of enclosed references
enclosed(fn)
// => [ "console", "String" ]

Now the only thing left for isolate to do is ensure that enclosed references are legit globals or built-ins and that nasty things like with and eval are not used.

If this experiment works out in practice that would allow us to explore a lot more to make new and brave concurrent world a lot more accessible and pleasant to use for our users.

All the libraries mentioned are open source and work both in SDK and Node, probably in browsers too. So feel free to play with them, break them and maybe even contribute fixes!

January 23, 2013 08:00 AM

Jetpack Project: weekly update for January 22, 2013

Project News

Much thanks to Mozillian Marc Chevrier for not only reporting but providing a patch for bug 829651. I love it when developers report into bugs with patches!

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2013-01-22 08:46:25 PST

Meeting Brief

  • Alex is really, really back. Mossop is sick :(
  • Good progress on most high priority goals, considering lowering the priority of cfx-in-js for the time being.
  • SDK: we’re pushing out rc3 today, we need ALL THE PATCHES
  • Roundtable – new engineer starting in early March, which is conveniently timed with a likely work week.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2013-01-22#Minutes

by Jeff Griffiths at January 23, 2013 12:45 AM

January 15, 2013

Jetpack Project: weekly update for January 15, 2013

Project News

I blogged last week about the 2013 Jetpack Roadmap; for this first quarter the Jetpack team is hard at work on a set of goals that will result in shipping the core apis in Firefox, quite likely in Firefox 21. If you want to follow that work there are a few different places to look:

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2013-01-15 13:53:36 PST

Meeting Brief

  • Alex is (almost) back from working on Gaia!
  • Discussion of what’s blocking us on our high priority list.
  • SDK: all our tests are orange due to bug 830573
  • Roundtable: Irakli needs to know about your API changes, and a possible devtools work week in California in March.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2013-01-15#Minutes

by Jeff Griffiths at January 15, 2013 10:48 PM

January 09, 2013

Jetpack Project: weekly update for January 08, 2013

Project News

  • It’s a new year! And with that comes a new SDK product road-map for 2013! The blog post is here, and if you have any feedback we’d love to hear about it on this Google groups thread.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2013-01-08 12:54:34 PST

Meeting Brief

  • P1 bugs: lots of discussion on landing plans, panel improvements and per-window private browsing.
  • SDK: Jeff & Matteo are working with the mobile team to resolve a regression in Firefox 19.
  • Roundtable: we talked over work week plans, a possible file API contribution, a code coverage update and a new blogging schedule for the new year.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2013-01-08#Minutes

by Jeff Griffiths at January 09, 2013 01:45 AM

January 08, 2013

Add-on SDK 2013 Roadmap

During December I worked with the rest of the SDK team as well as other stakeholders to develop a product road-map for the SDK for the next year. This road-map planning is critical as 2013 promises to be a very eventful year for both the Jetpack team and the SDK, and I think a very, very positive one.

The entire road-map is available here on the public Mozilla wiki, but I would also like to take the to briefly highlight three significant points here.

Landing the SDK’s APIs in Firefox

A lot of work went into achieving this goal during 2012 starting with Myk’s Jetpack Features meetings and eventually a major re-factoring the SDK to better fit into the Firefox code-base. As 2013 opens we already have experimental builds available on the larch branch and are working with Release Engineering to ensure that the SDK’s tests behave more like the rest of the Firefox test suite ( and also that we don’t set the tree on fire! ).

The next step is to merge from larch to mozilla-inbound on January 15th, one week from now. The SDK’s APIs will then ride the release trains to be released in May as part of Firefox 21. There are a number of moving parts regarding this move to built-in APIs including add-on re-packs that are detailed on the wiki here.

Amazing UI integration for add-ons

There have been some proposals around for some time to provide better UI integration APIs for add-ons, and in particular I am a huge fan of Stephen Horlanders mock-ups from early last year. We plan to implement an initial cut of this work with some simpler widgets available to start. We also want to ensure that developers are able to either enhance existing widgets or create their own as third-party modules.

Awesome Developer tools for add-on developers

The developer tools now shipped with Firefox are, in a word, splendid, so much so that we are really excited about working with the rest of the developer tools teams to leverage these new capabilities to benefit add-on developers. In particular we think it should be just as easy to debug JS running in your add-on as it currently is to debug a web page. There is a lot of enthusiasm for this idea on the team, but the scope is poorly defined currently. Expect much more detail from me about this once the dust settles and we’ve had some more serious discussions with the rest of the dev tools team.

Aside

I carefully worded the second and third points to not specifically mention the SDK but instead to purposefully target these features ‘for add-ons’ or ‘for add-on developers’. As Dave Townsend declared in his post from last October, “Jetpack makes it easier to develop features for Firefox”. While we will continue to provide packaging tools and other useful bits for people who are used to developing for the SDK, the SDK is no longer a walled garden that add-on developers have to commit to in order to benefit from what we have built.

Got feedback?

As I sometimes do with these posts, I have disabled comments and would like to encourage you instead to join the conversation in this thread in the Jetpack Google Group. Thanks for understanding!

by Jeff Griffiths at January 08, 2013 11:19 PM

December 31, 2012

Offline AddonSDK (#jetpack) activities

One of the coolest way to bring the knowledge to the masses is to …write an article for a magazine. I know it’s kinda old fashion, but there are a lot of people that are reading actually magazines.

I will write 2 articles in next several days about JetPack and AddOns in general for JSMag and .Net Magazine (Bulgarian edition) and I hope I will get more people trying to write an AddOn or just diving into this new technology.

jsmag netmag.bg

I will be stick on:

0. What is an Addon and why we should create more of them.
1. JetPack Architecture and structure.
2. JetPack API (panel, widget and more).
3. How to write an external reusable library.
4. How to remix the code and add your JS to an AddOn;
5. How to use SDK to develop, pack and test your AddOn.

Any recommendations?

by Bogomil Shopov at December 31, 2012 12:26 PM

Mozilla #JetPack: Create a simple debugger

So I wanted to create a simple JetPack debugger that will write me some data and will dump me some objects on my …Firefox error console.

Here is the code. This simple tutorial shows :

0. How to use some of Firefox Services via Services.jsm
1. How to work with nsIConsoleService

Why I need that? Well I want to debug some of my extensions without using console/notifications or Firebug. This can be usable for getting better support for users. You can always put some debug lines on your code that will be visible for your addon user.

Anyway this is an example library and it’s not for production use :)

by Bogomil Shopov at December 31, 2012 12:26 PM

Mozilla Jetpack talk at #OpenCamp

Here is the background for my JetPack talk next week:
Jetpack

I will be talking and hacking about:

0. What is an Addon and why we should create more of them.
1. What is XUL and what is JetPack about.
2. JetPack Architecture and structure.
3. JetPack API (panel, widget and more).
4. How to write an external reusable library.
5. How to remix the code and add your JS to an Addon;
6. How to use SDK to develop, pack and test your Addon.
7. Bamo vs. your own IDE.
8. How to add your addon to AMO website
9. Q&A

by Bogomil Shopov at December 31, 2012 12:26 PM

Create a class-based library in #JetPack (addon SDK)

I just commit to GitHub a class based library called JPersona..

You can get the background color and text color of the active persona your Firefox is wearing and to do whatever you want.

This example shows :
0. How to import LightweightThemeManager – the one responsible for handling Personas.
1. How to write class-based library for JetPack
2. How to import this library in your main.js and how to use it.

Go now to github and give me a feedback

by Bogomil Shopov at December 31, 2012 12:26 PM

Get current active theme in #JetPack

I need to know ID of current active Firefox Persona in order to get the textcolor value from users.pref to be able to display different icons on my widget, because I don’t wont to display blue icon on blue background.

This tutorial shows:

      How to access Addon Manager from a JetPack script
      How to get all Addons based on their type [extension, theme, locale, multipackage]
      How to get Active Persona’s ID

It’s a lot for such short script, isn’t it?

 
//we need this component
const {Cu} = require("chrome");
 
//import AddonManager
var AddonManager = Cu.import("resource://gre/modules/AddonManager.jsm")
                              .AddonManager;
 
//We need to get all Addons that are with type 'theme'
var types =['theme'];
 
//get all themes
var currentTheme = AddonManager
                          .getAddonsByTypes(types,function(addons){
	//Firefox always shows active theme as 0 element (not sure, need confirmation)
 
       //get the ID of the active theme/persona
	var tid=addons[0].id.toString();
 
        //show it in console 
        console.log("Current Id:"+ tid);
});

Unfortunatelly textcolor value is not part of the object (yet) and the only way to find it is to check with this id (tid) in prefs.js

by Bogomil Shopov at December 31, 2012 12:26 PM

#Javascript survey results and #jetpack

Some time ago I have posted a call for javascript hackers to fill a survey in order to help me to create a better world.

0. Here are the results:

What OS you are using while hacking the code?

Gnu/Linux 239 40%
MS Windows 236 39%
MacOS 291 48%
Other 7 1%

What’s your location?

Europe 394 65%
South America 7 1%
North America 161 27%
Asia 23 4%
Africa 1 0%
Australia 8 1%
New Zealand 3 0%
Moon :) 17 3%
Other 15 2%
People may select more than one checkbox, so percentages may add up to more than 100%.

What is your IDE?

This was an input filed:
Aptana, Eclipse, TextMate,BBedit,Coda, Dreamweaver and more as you can see here.

Why I need that?

I am part of Mozilla’s JetPack community and I am researching how to make our life easier by creating plugins and snippets (maybe debuggers) for most popular IDE’s in the #JS world in order to allow rapid development of Firefox Addons using AddonSDK (a.k.a JetPack).

You can see my prototype here and version 0.2 here.

Can I help?

Of course you can. If you know how to write plugins for any IDE or if you have any other idea how we can make our life easier – please drop me a note here or on identi.ca nor twitter

by Bogomil Shopov at December 31, 2012 12:26 PM

JetPack: How to add a button to a webpage + events

This is a Jetpack example for beginners that shows:

0. How to add a simple DOM element – button to a webpage using Mozilla Addon SDK (Jetpack)
1. How to attach an event
2. And how to handle it.

If you want to try it – go here click on Test icon and when it loads, visit: http://talkweb.eu/labs/jetpack/button.html or use your own SDK

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
var buttonScript = [
'var butt = document.createElement("button");', //define button element
'var btext = document.createTextNode("Click me");', //define the text
'butt.appendChild(btext);', //attach text to the button
'butt.addEventListener("click", function(){document.bgColor="red"} , false)', //handle onclick event
'document.getElementById("test").appendChild(butt);' //put the button on the page
];
 
 
var pageButton = require("page-mod").PageMod({
include: 'http://talkweb.eu/labs/jetpack/button.html', // this script will works only on this website
contentScriptWhen: 'ready',
contentScript: buttonScript
});

by Bogomil Shopov at December 31, 2012 12:26 PM

Is it (Mozilla) Jetpack still confusing?

If you want to create an unique technology maybe you should to create an unique name or create an unique strategy to connect the term with your technology and leave others alone :)

Currently there are a lot of JetPack terms related to technology:

0. JetPack me – Great, great WordPress plugin
1. Microsoft JetPack
2. A game
3. An AD system
4. Mozilla JetPack

Do you think It’s a bit still confusing for a developer who is looking for some help to find it?

by Bogomil Shopov at December 31, 2012 12:26 PM

Are you interested in learning something new and cool?

Well, why don’t you join me at P2PU in a Mozilla JetPack course. The main idea of P2PU is to give the opportunity to anyone to teach anyone to a certain topic.

It doesn’t matter if you are beginner or if you are Mozilla JetPack guru – P2PU course perfect place for you to learn or to share knowledge.

If you are part of Facebook, please join the JetHack group also.

by Bogomil Shopov at December 31, 2012 12:26 PM

Jetpack.ruble 0.2

My jetpack.ruble project has a new version. Hooray. The idea is to provide a rapid development tools for opensource IDE called Aptana, as a part of a bigger project to provide such tools for all Open Source tools we’re using.

Of course it’s still experimental, but as soon as I found some time I will create some nice features like snippets and preferences.

Here is the URL in GitHub – if you are interested, please watch it.

Help
Also I still need help. If you are JS hacker, please answer me this questions 3: http://talkweb.eu/openweb/768

by Bogomil Shopov at December 31, 2012 12:26 PM

Converting your IDE into a powerful JetPack machine

I just started a project at GitHub to add a command bundle for my Aptana IDE (it’s Eclipse based) for Mozilla JetPack.

Right now it’s just a skeleton and contains only ‘cfx – run’ command, but the main idea is to create bunch of snipplets and to add more command in near future for rapid JetPack development.

Here are some screenshots:

Here is how the menu looks like:

Let’s see it in action:

You can use the shortcut also (CTRL +R)

Join
If you want to download it or if you want to join this interesting project, please visit GitHub or drop me a line here.

Video
To see it with good quality, click Right button – and select ‘View Video’ or select “Full screen”

This video shows what happens after ‘CTRL + R’ combination (see above). The automation is real :)

by Bogomil Shopov at December 31, 2012 12:26 PM

Make me run and support your favorite opensource project

Couple of months ago I started a little “via Twitter” only campaign and now I think it’s the time to give it more visibility, because the deadline is in 20 days.

What?

The main idea is:  for every tweet [tooltip title="Yes I Will" gravity="e"][mark color="yellow"]I will run 1[/mark][/tooltip] meter on Prague Marathon on September 8th 2012 (yes in 20 days) and will donate some money to an open source project.

How?

[box color="orange" icon="flag"]
Join the campaign now – it’s FUN. Fell more than free to share it with your friends.
[/box]

by Bogomil Shopov at December 31, 2012 12:26 PM

December 18, 2012

Jetpack Project: weekly update for December 18, 2012

Project News

  • We released 1.12 last Tuesday, but there was no weekly update here due to a particularly busy week at an Add-ons Work Week last week.
  • Even better, despite some major differences introduced in SDK 1.12, Piotr was able to get Builder updated to support 1.12 last Wednesday.
  • Today’s Jetpack meeting was the last meeting of 2012! In fact, there will not be another meeting until Tuesday, January 8th, 2013.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2012-12-18 09:13:09 PST

Meeting Brief

  • SDK: high priority bugs, Per-Window Private Browsing, module versioning in the loader and 404s in the docs.
  • The tree is orange, but GitGutter for ST2 is awesome!

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2012-12-18#Minutes

by Jeff Griffiths at December 18, 2012 10:42 PM

December 11, 2012

Announcing Add-on SDK 1.12!

I’m pleased to announce that we have released SDK 1.12 today; you can download the SDK directly in either zip or tarball format.

Update: The Add-on Builder has now been updated to support SDK 1.12.

What’s new?

Enhancements to simple-prefs. I’m really pleased to include in this release some much-needed enhancements to the simple-prefs module by contributor ‘taku0‘. Taku0 has really stepped up by implementing radio button and drop-list widgets for simple prefs. Thanks Taku0! Simple-prefs is pretty awesome now, so much so that I cooked up this example on github that displays all the types of prefs you can now use.

SDK layout changes. As I mentioned in my post a few weeks ago, we have dramatically changed the file system layout of the SDK in 1.12 in preparation for shipping the SDK apis in Firefox itself. The next few releases of the SDK will use this layout and we have plans to start testing builds of Firefox with the SDK embedded to ensure that tools such as the Add-on Builder continue to work.

Firefox Mobile support improvements. We’ve implemented support for the tabs api on Firefox for Android, which is a key module that both enables many common add-on use cases, and was also causing many of our tests to fail. If you’ve been curious about kicking the tires using the SDK on mobile, this new version is a good starting point.

You can much more detail about SDK 1.12 in the release notes.

Some interesting stats about this release ( from the github history between the 1.11 & 1.12 tags ):

  • 294 changes in 50 pull requests between tags 1.11 and 1.12
  • Community contributors: Blake Winton, Gregg Lind, Markus Stange and taku0.

As always, we’d love to hear from you about your experiences with this release. You can contact us in a variety of ways:

post to our discussion group
chat with us on irc.mozilla.org #jetpack
report a bug
check out the source and contribute bug fixes, enhancements, or documentation

For more information on the Jetpack Project check out our wiki.

by Jeff Griffiths at December 11, 2012 10:31 PM

December 04, 2012

Jetpack Project: weekly update for December 04, 2012

Project News

  • We released SDK 1.12 RC3, available in zip or tarball format. As we have mentioned before, the SDK file layout has significantly changed between 1.11 and 1.12, so please take the time to test this RC out and report any issues you might have, ideally to bugzilla.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2012-12-04 07:56:10 PST

Meeting Brief

  • SDK: 1.12 on schedule for release next week
  • Roundtable: discussion of the WebSocket bug, security concerns with cross-domain xhr in content scripts, private browsing issues.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2012-12-04#Minutes

by Jeff Griffiths at December 04, 2012 09:37 PM

November 21, 2012

Jetpack Project: weekly update for November 20, 2012

Project News

  • SDK 1.12RC1 ships today, there are just some documentation updates for it
  • The Jetpack team’s joining the Developer Tools group: this is in line with our desire to use the SDK APIs to develop new Firefox features.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2012-11-20 17:17:56 PST

Meeting Brief

  • 1.12RC1 to ship today.
  • Gabor’s writing a blog post on add-on security: we should include a version of this in the SDK docs.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2012-11-20#Minutes

by wbamberg at November 21, 2012 01:32 AM

November 14, 2012

Jetpack Project: weekly update for November 13, 2012

Project News

  • Half the team are in Singapore for Mozcamp Asia, where they’ll be talking about mobile development and adding Firefox features using the SDK.
  • SDK 1.12b2 shipped today. This release contains a major reorganization of the code, which is a prerequisite for landing in Firefox. So we’d love for you to try it out and give us your feedback.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2012-11-13 20:50:42 PST

Meeting Brief

Before landing the SDK’s APIs in Firefox, we’re going to test it out using a branch that mirrors mozilla-central. We now have a bug to kick this process off.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2012-11-13#Minutes

by wbamberg at November 14, 2012 05:06 AM

November 12, 2012

interactivate

I have made a little live-coding experiment that is primarily inspired by Mathematica notepad, Bret Victor’s Inventing on Principle and has being pioneered by othe cool projects like light table.

I do write JS & HTML every single day and I can’t even imagine doing that without a REPL. Although scratchpad made me realized how I hate loop part of REPL! Another problem is an amount of time one needs to waste, while being inspired, to get a glimpse of an idea, live on a screen. Creating HTML, JS files wiring them with each other, page refreshes, etc… I’m sure we can do better than that, here is a little demo of what I think it should be like:

You can give it a try yourself or check out the code on github.

This expreiment was done in a couple of hours, so it’s far from being stable. It has bunch of known bugs than I need to fix, but I still hope it was worth sharing.

Making this would have being impossible without awesome open source projects like codemirror & browserify who’m I wish to give a good credit.

Finally I really hope to see Scratchpad picking up some of this soon!

November 12, 2012 08:00 AM

November 06, 2012

Jetpack Project: weekly update for November 06, 2012

Project News

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2012-11-06 08:57:00 PST

Meeting Brief

  • Builder: I reported to the team on some coarse AMO stats showing Builder add-ons vs the downloaded SDK.
  • SDK: No beta today – only one change since last week.
  • Roundtable: more code coverage info from Gregg, mobile testing, discussion around the feature miss survey.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2012-11-06#Minutes

by Jeff Griffiths at November 06, 2012 08:10 PM

November 05, 2012

SDK private-browsing API deprecation

If you’ve looked through the documentation for Add-on SDK 1.11, you may have noticed that the page documenting the private-browsing module contains the following message:

The activate and deactivate methods are now deprecated. They will continue to work until version 1.13 of the SDK. From version 1.13 onwards they will still exist but will have no effect when called.

While the Jetpack project has often in the past declared a goal of maintaining forward-compatibility of high-level apis. I feel strongly that we should whenever possible maintain api compatibility so that add-on developers can depend on the SDK’s apis to work even as months go by and any number of new Firefox versions are released into the wilds of the web.

Sometimes the issue of backwards compatibility is out of our hands and changes to Firefox necessitate that we change high-level apis in the SDFK in order to keep pace. The current work on implementing per-window private browsing in Firefox is just such an issue, and as such we’ve taken steps in the recently released SDK 1.11 to print deprecation warnings for the ‘activate’ and ‘deactivate’ methods in the SDK’s private-browsing module to the error log.

For the time being these methods will continue to work, but per-window private browsing ( PWPB for short ) is a new set to debut in Firefox 20 (or so) that fundamentally changes how Firefox behaves. The new implementation breaks the assumptions that the SDK’s private browsing module makes about what is possible, so we have taken steps to deprecate parts of this module. To be specific, the ‘activate’ and ‘deactivate’ methods in the private-browsing module now produce deprecation warnings:

Timestamp: 2012-11-05 1:39:42 PM
Error: pb-deprecation-example: DEPRECATED: require("private-browsing").activate 
and require("private-browsing").deactivate is deprecated.

Here’s an example of code that will trigger this behaviour:

var pb = require("private-browsing");
 
require("widget").Widget({
    id: 'pb-foo',
	label: 'PB, TOGGLE!',
	contentURL: 'http://www.mozilla.org/favicon.ico',
	onClick: function() {
        if (pb.isActive) {
            pb.deactivate();
        }
        else {
            pb.activate();   
        }
	}
});

To easily try this out, please see this builder example.

We expect to ship per-window private browsing in Firefox 20, and once Firefox no longer supports the old private browsing mode any calls to the deprecated methods in the private-browsing module will have no effect. If your add-on uses these apis, you should look instead at bug 808747 which will track how we support per-window private browsing.

by Jeff Griffiths at November 05, 2012 10:14 PM

November 01, 2012

Call for testers! SDK 1.12 Beta 1 now available.

As Wes mentioned in his post to the Jetpack Google Group, we have spun some test builds of SDK 1.12 Beta 1 ( available as a zip archive or a tarball ) and hope that people will take the time to test their existing add-on project with this new version.

Testing your code with 1.12 is particularly important during the Beta cycle as we have landed major changes to how the SDK is organized and some code that uses lower-level functionality may no longer work. We’ve done a lot of work in order to make sure that most use cases will ‘just work’, but we’d love your feedback and in particular we’d like to hear about any issues you might run into.

FAQ

Q: Why are we making this change?
A: The layout change was necessary in order to prepare the SDK APIs to be added to Mozilla central and eventually shipped with Firefox. You can get more information on the overall project to land the APIs in Firefox on this page, and a more detailed description of the layout change on this page.

Q: What sort of errors should I look for?
A: If there is a problem, it will be because the SDK’s loader cannot find a module, causing a fatal error any time you try to run, test or package your add-on. You’ll see an error like this:

ModuleNotFoundError: unable to satisfy: require(path/to/module) from
/Users/jeff/code/jetpack/projects/test/loader_err/lib/main.js:1:
Looked for it in:
/Users/jeff/code/jetpack/projects/test/loader_err/lib/path/to/module.js
/Users/jeff/code/jetpack/addon-sdk/lib/path/to/module.js
/Users/jeff/code/jetpack/projects/test/loader_err/lib/path/to/module.js

If you run into issues like this, we’d like to know about it, either by posting to the Google Group or logging an SDK bug. You can also fix your code immediately by looking at the current layout of the SDK’s apis and correcting the require statement.

Q: I use Builder – how can I test this?
A: You can only test this by downloading the Beta release linked above and using it locally from the command-line. We do not update Builder with Beta revisions of the SDK, and given the scope of the changes we’ve made to the SDK we are currently evaluating what changes Builder requires in order to work with this new version. If you need help installing and using the SDK on the command-line, please see the installation docs.

Got more questions? Please post to the thread in the Google Group – I’ve disabled comments on this blog post in order to centralize any discussion there.

by Jeff Griffiths at November 01, 2012 11:56 PM

October 30, 2012

Jetpack Project: weekly update for October 30, 2012

Project News

  • SDK 1.11 was released today – go get it!
  • Ever wonder what the most popular SDK-based add-on is? By a large margin, the number one spot is ‘Easy Youtube Video Downloader‘ with over 2 million users!
  • If you’re attending Mozcamp or are in the Singapore area on the evening of Nov 15th, Jetpack developers Matteo Feretti & Erik Vold will be giving a workshop on developing mobile add-ons at the Hub. Stay tuned here or follow the @mozillajetpack twitter account for more details.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2012-10-30 14:17:09 PDT

Meeting Brief

  • Builder: optimistic about pushing 1.11 to Builder production tomorrow.
  • SDK: 1.11 release today!
  • Roundtable: 87% of Fennec tests are passing! CFX-JS tests are passing in node and SDK! Also Mozcamp plans and a slight delay in Erik’s awesomeness.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2012-10-30#Minutes

by Jeff Griffiths at October 30, 2012 09:47 PM

Announcing Add-on SDK 1.11!

The Jetpack team is terribly pleased to announce the immediate availability of SDK 1.11. You can download the SDK directly in either zip or tarball format.

What’s new?

SDK 1.11 is the most significant release in recent memory, largely due to the enhancements we’ve made to the page-mod module. Page-mod is easily one of the most popular and powerful modules we provide in the SDK, and we think these enhancements bring the module’s capabilities in line with what developers are demanding:

  • When a user installs an add-on that implements a page-mod, any existing pages that would match your include criteria are applied instantly.
  • Conversely, when an add-on is uninstalled any live page-mods are removed dynamically.
  • Page-mod now features fine-grained control over which documents are injected not only based on url, but also whether the document is loaded into an frame/iframe or is the top-level document.

For a full explanation please see these excellent blog posts from Alex and Matteo, and of course the docs. For more new features and a list of the bug fixes that are shipping in this release, please see the Release Notes and the full documentation.

Some interesting stats about this release ( from the github history between the 1.10 & 1.11 tags ):

  • 201 changes in 60 pull requests between tags 1.10 and 1.11
  • Community contributors: Arky & Gregg Lind

As always, we’d love to hear from you about your experiences with this release. You can contact us in a variety of ways:

post to our discussion group
chat with us on irc.mozilla.org #jetpack
report a bug
check out the source and contribute bug fixes, enhancements, or documentation

For more information on the Jetpack Project check out our wiki.

by Jeff Griffiths at October 30, 2012 01:27 AM

October 29, 2012

Recent changes in SDK

There have being some significant changes to the Add-on SDK lately, which is a step forward to landing and shipping SDK in Firefox. In this post I’ll try to cover what the changes are.

Probably the most important detail is that SDK no longer uses packages. This is an improvement for two reasons:

  1. once SDK is in Firefox we won’t be able to perform complicated module search at compile time and even more so at runtime.
  2. We also see it as great improvement to current ambiguous behavior of require. Now SDK is just a library of modules. Once it’s in Firefox, all addons will be able to load any SDK module without needing to convert completely to an SDK-style project.
  3. We also hope to empower other Mozilla projects with CommonJS so that new APIs & features can be authored in de facto standard CommonJS module format.

Going forward, the idiomatic way to require an SDK modules now is: require("sdk/panel"). Low level and usually less stable APIs will have longer require paths: require("sdk/window/utils").

To ensure that addons built using the old layout are not affected by this change we have analyzed all the module requirements of all AMO hosted addons and created a mapping that maps module requirements used to a new style. CFX - SDK’s CLI tool uses this mapping to allow backwards compatible behavior, while we have no plans on breaking backwards compatibility in a visible future, we still would like to encourage authoring new add-ons in idiamatic style this will make your code a lot more portable!

This new layout is currently on the Master branch and is scheduled to be released on December 11 as version 1.12.

October 29, 2012 07:00 AM

October 23, 2012

Jetpack Project: weekly update for October 23, 2012

Project News

  • If you’re excited about that hot new ‘gcli’ toolbar in the Firefox developer tools and want to get started creating your own gcli commands and distributing them via extensions, look no further then Erik Vold’s gcli module!
  • We’re landing a few late-breaking fixed for 1.11, so expect an RC2 announcement form Wes tomorrow on the email list.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2012-10-23 10:03:14 PDT

Meeting Brief

  • Builder: Piotr is evaluating changes needed to support 1.12 layout changes.
  • SDK: delaying RC2 of 1.11 until tomorrow to catch some late-breaking page-mod fixes
  • Roundtable: module metadata, Fennec tabs, Seamonkey(!) and GCLI extensibility.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2012-10-23#Minutes

by Jeff Griffiths at October 23, 2012 10:01 PM

October 09, 2012

Jetpack Project: weekly update for October 09, 2012

Project News

  • Mozilla Labs just pushed out this awesome ‘about:profile‘ add-on that shows an interesting break-down of your web rowsing history – made with the SDK of course!
  • SDK developer Matteo Ferretti has been working on some new modules that are ready for people to test out – ‘Geolocation‘ is self-explanatory and ‘Doorhanger‘ implements a simple api to do in-browser UI notifications on both mobile and desktop. If you use these modules and run into issues, please file them in each modules’ respective Github page. Remember: there are lots of other modules you can use with the SDK listed on this github page.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2012-10-09 10:44:41 PDT

Meeting Brief

  • Builder: no updates to report.
  • SDK: shipping 1.11 Beta 2 today, need to get docs generation working to land the SDK layout changes.
  • Roundtable: SDK module loader ships in Firfox 16 today, plus some cool add-ons and modules.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2012-10-09#Minutes

by Jeff Griffiths at October 09, 2012 09:27 PM

October 02, 2012

Jetpack Project: weekly update for October 02, 2012

Project News

  • Erik blogged about his excellent work on porting the SDK’s windows and tabs modules to Mobile Firefox!
  • Not to be outdone, Will also blogged about our recently retro-fitted module lifecycle process and policies.
  • Will has also just kicked off a lively thread over in the Jetpack Google Group about community-developed modules. If you’ve got opinions, favorites, or a secret-but-awesome module or module idea you want to share, check it out!
  • After what could best be described as not a great week for Builder, we were able to push the correct version of SDK 1.10 to builder yesterday. If you use builder and have submitted an add-on to the AMO queues in the last week or so, please replace that xpi build with a fresh one!

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2012-10-02 09:39:48 PDT

Meeting Brief

  • Helping FirefoxOS: Alex will be on loan to the Gaia team for the foresee-able future – please do not assign reviews to him!
  • Builder: we pushed the correct version of 1.10 to builder yesterday after some delays from last week.
  • SDK: looking at a panel bugs and reducing cruft in the pull request list – also, we can craft test add-ons, to, er, test things.
  • Roundtable: some of the team have been blogging up a storm, while others are heading to Berlin this week for JSConf.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2012-10-02#Minutes

by Jeff Griffiths at October 02, 2012 09:59 PM

October 01, 2012

A lifecycle for the Add-on SDK’s APIs

Until now we’ve not had a very well-defined lifecycle for APIs in the Add-on SDK. We’ve said, broadly, that APIs in the addon-kit package are “supported”, meaning we won’t change them “unless absolutely necessary”, while APIs in the lower-level api-utils package are “not fully stabilized”, meaning that we expect to make incompatible changes to them.

There are some exceptions to this broad rule: some newer modules in addon-kit, like simple-prefs, have been marked as “experimental”, and we’ve deprecated a few APIs in addon-kit, such as the global postMessage() and on() functions in content scripts. More recently we’ve landed a lot of changes to the SDK’s internals, and as a result several modules in api-utils are effectively obsolete and should no longer be used.

Without a process for promoting modules from “experimental” to “supported”, for deprecating APIs, or for removing deprecated APIs, things tend to stagnate:

  • new modules stay “experimental” for longer than they should, meaning developers can’t rely on them not to change unexpectedly
  • developers can’t distinguish between new and obsolete APIs (should we use window-utils or window/utils)?
  • deprecated APIs hang around indefinitely, increasing the support burden and making the SDK more confusing to use

When the Jetpack team met up a few weeks ago one of the things we talked about was a process for defining and communicating the stability of our APIs, and for deprecating and eventually removing obsolete APIs.

The lifecycle we’ve drafted has two main components:

  • a “stability index”, that defines how stable each module is
  • a deprecation process that is intended to enable the SDK to remove or change APIs when necessary, while giving developers enough time to update their code.

Stability Index

The stability index is adopted from node.js. Each module is assigned one of six values:

  1. Deprecated
  2. Experimental
  3. Unstable
  4. Stable
  5. API Frozen
  6. Locked

The stability index for each module is written into that module’s metadata structure:
* page-mod is stable
* addon-page is experimental

For the time being, we’ll only use three of these values:

  • Experimental: this means that the module is not yet stabilized. You can try it out and provide feedback, but we may change or remove it in future versions without having to pass through a formal deprecation process.
  • Stable: this means that the module is a fully-supported part of the SDK. We will avoid breaking backwards compatibility unless absolutely necessary. If we do have to make backwards-incompatible changes, we will go through the formal deprecation process.
  • Deprecated: we plan to change this module, and backwards compatibility should not be expected. Don’t start using it, and plan to migrate away from this module to its replacement.

In future releases, the SDK will read these values and expose them in the docs: in fact, the SDK will eventually remove the “package” structure entirely, and then cfx docs will organize modules according to their stability rather than by package.

We’ll periodically review APIs that are marked as “experimental” and, if possible, raise bugs to promote them to “stable”.

Right now, we’ve raised bugs to stabilize some “experimental” APIs in addon-kit:
* the addon-page module
* the simple-prefs module
* page script access to messaging.

Deprecation Process

We’ve drafted a deprecation process on the Jetpack Wiki. In summary, to remove or change any “stable” API, we’ll:

  • develop and document alternatives for any APIs we wish to deprecate
  • communicate the deprecation, and support developers in migrating
    to the alternative
  • start issuing warnings for code that uses deprecated APIs
  • keep deprecated APIs for at least three releases (18 weeks)
    after deprecation, and longer if they are still seeing enough use.

Once the process is ready to go, we’ll deprecate a number of obsolete modules in api-utils.

What’s Next?

This process is itself still in the “experimental” state! If you have any feedback about how we can make it better, we’d love to hear from you in comments to this post or via any of the usual channels:

by wbamberg at October 01, 2012 11:46 PM

September 25, 2012

Jetpack Project: weekly update for September 25, 2012

Project News

You may have seen a post from Alex Keybl yesterday on changes to Firefox’s release schedule coming up at the end of the year:

We’re going to extend the 11/19/2012 – 12/31/2012 cycle by a week, with a revised end of 1/6/2013. Given the timeline change, we’re targeting release of Firefox 18 for the middle of that week.

We decided today that this will affect the SDK release schedule as well, pushing all planned SDK releases 1 week starting in January 2013. This will be reflected in the officially published release schedule for the SDK once we update it for 2013.

Other news:

  • Wes blogged all the gory detail about the SDK release process.
  • Not to be outdone, Alex blogged about all the cool bits going into SDK 1.11 next month, in particular around the ever-popular page-mod module.

Quick Stats

Note: the stats above are based on the queries I linked to for each item. If you have suggestions on how these queries might be made more accurate,please comment below. Stats generated at 2012-09-25 09:50:59 PDT

Meeting Brief

  • Builder: investigating validation issues, should have a fix later today.
  • SDK: reviewed Q3/Q4 goals; Wes will be spinning 1.11b1 builds later today.
  • Roundtable: blogging from Wes & Alex, Mozcamp plans, 1st draft of Irakli’s plan to land in m-c.

Full minutes are available here:
https://wiki.mozilla.org/Jetpack/Weekly_Meeting/2012-09-25#Minutes

by Jeff Griffiths at September 25, 2012 10:29 PM

September 21, 2012

SDK re-pack progress

We have made great strides in our efforts to automatically re-pack SDK add-ons to a recent version. As part of this effort I recently sent a few hundred emails ( with help from IT of course ) to add-on authors asking for help to test and update re-packed versions of their add-ons. If you ave uploaded an SDK-based add-on to AMO in the last year or so, you probably got one of these emails.

As I stated in the email, if you have soem time we would really appreciate your feedback, either via this Google form or the Jetpack Google group. Specifically, we would like to hear of any issues you ran into. The one known issue we have so far is 2 cases where we re-packed an older version of an extension.

If your add-on does work, we would also appreciate if you could upload this re-packed version to AMO. This is particularly important to ensure that your add-on benefits with the numerous bug fixes and compatibility problems we have fixed in the SDK in the last year!

Our longer term goal is of course landing the SDK apis in Firefox itself, removing the need for developers to re-pack their add-ons to get the latest version of the SDK. Stay tuned to this space for more details in the next week or so on when and how we plan to to that.

by Jeff Griffiths at September 21, 2012 07:30 PM

September 19, 2012

Link: “Addon SDK 1.11 – the Page-mod Release”

There is no doubt that modifying web content is one of the most popular features in the SDK. With this in mind, the SDK team is very excited about the upcoming 1.11 release. SDK Engineer Alexandre Poirot posted a nice overview of the key features we’ve been working on:

page-mod API is the most commonly used API in jetpack. It allows to execute Javascript piece of code against any given website. It is very similar to greasemonkey and userscripts.

In Addon SDK version 1.11, which is due for October, 30th, we will bring various subtle but very important fixes, features and improvements to this API. In the meantime we will start releasing beta versions on tuesday (09/25) with 1.11b1.

Click here to read the full post…

You can download a zip file of 1.11 aka the current stabilization branch here. If you use page-mod in your add-on, please help us test these changes with your add-on, and report any issues you encounter either to bugzilla or the google group.

by Jeff Griffiths at September 19, 2012 08:23 PM

Addon SDK 1.11 - the page-mod release

page-mod API is the most commonly used API in jetpack. It allows to execute Javascript piece of code against any given website. It is very similar to greasemonkey and userscripts.

In Addon SDK version 1.11, which is due for October, 30th, we will bring various subtle but very important fixes, features and improvements to this API. In the meantime we will start releasing beta versions on tuesday (09/25) with 1.11b1.

Here is an overview of these changes:

  1. You will now be able to execute page-mod scripts to already opened tab, by using the new attachTo option. [bug 708190]

  2. With the same attachTo option, you can execute page-mod scripts only on top-level tab documents, and so avoid being applied to iframes. The following blogpost goes into detail about this new option. [bug 684047]

  3. page-mod now ignores non-tab documents like: panel, widget, sidebar, hidden document living in firefox’s hidden window, … [bug 777632]

  4. Your addon will be more efficient as we removed some costly workaround: the Javascript proxies layer between your content script and the page. We are now relying directly on C++ wrappers, also known as Xraywrappers. We are expecting a major improvement in term of memory and CPU usage. As this change depends on modifications made in Firefox, it will only be enabled on Firefox 17 and greater. [bug 786976]

  5. Content scripts are now correctly frozen when you go back and forth in tab history. Before that, your content script was still alive and could throw some unexpected exception or modify an unexpected document. [bug 766088]

  6. Random fixes: window.top and window.parent will be correct for iframes [bug 784431].

  7. Last but not least and still at risk for 1.11 release. You will be able to extend priviledges of your content script to extra domains. So that your script will now be able to execute some action on your own domain in addition to the current page domain, without facing cross domain limitations. This rely on some improvements being made to Firefox and will only be enabled on Firefox 17+. [bug 786681]

It is realy exciting to see our most used API receiving so many improvements and I hope that we fixed most of the long-living issues you may have faced with page-mod!!

We would really like to get your feedback on these changes. If you find anything wrong, please, file bugs here and do not hesitate to come discuss with our team in the mailing-list

September 19, 2012 12:00 AM