Labs/Jetpack/Release Notes/1.0b1
About
Add-on SDK is a software development kit that provides a set of tools and APIs for building, testing, and packaging Firefox add-ons.
The 1.0b1 release is the first beta release of the SDK. It includes many changes from the previous version of the software, the most notable of which are listed below. Effective this release, the kit has also been renamed from Jetpack SDK to Add-on SDK.
Installation
Obtain the SDK in your favorite compression format:
Then unpack the archive, open the addon-sdk-1.0b1/README.txt file, and follow its instructions.
Notable Changes
New Features
- The
cfx initcommand constructs the basic directory structure of an add-on to make it easy to start building one. (bug 566814) - It is now possible to use an ID in one of the two traditional formats used by Mozilla add-ons, which is useful when migrating a traditional XUL add-on to the SDK. (bug 604499)
- Add-ons created using the SDK can now easily specify an icon to represent them in Firefox's Add-on Manager and other places. Simply drop a PNG file named
icon.pnginto the root of your add-on's package directory. (bug 588119)
Electrolysis
Electrolysis (E10S) is a project to load and render/execute browser UI, web content, plugins, and add-ons in separate processes. We are in the process of modifying the SDK's add-on loader to load SDK-based add-ons in separate processes.
- The Widget API has been redesigned to be E10S-compatible. (bug 569479)
- Events related to web content, and direct access to Widget content, has been removed from the API.
- Support for interacting with Widget content via content scripts has been added to the API.
- The
imageproperty of the Widget API has been renamed tocontentURLto make its interface consistent with that of other APIs that use content scripts.
- The Tabs module has been redesigned to to be E10S-compatible. (bug 593908)
- Experimental support for loading add-ons in separate processes has been added to the SDK. An add-on will be executed in a separate process if the
--e10soption is passed to thecfxtool. The feature is not yet documented in the SDK documentation, but the documentation for the proof-of-concept implementation remains largely accurate. (bug 567703)
Object Construction and Destruction
Object construction and destruction has been simplified for a number of APIs that create persistent user interface elements or data structures. It is no longer necessary to both construct an object and add it to a registry of such objects via an add() method call in order for the object to persist. Such objects now persist by default for the life of the browsing session (or until the add-on is disabled/uninstalled), and to destroy them you call their destroy() method instead of removing them from an object registry via a remove() method call.
The new behavior applies to the following objects:
- Panel
- Page (from the Page Worker API)
- Widget
- Menu, MenuItem, MenuSeparator (from the Context Menu API)
- PageMod
Event Handling
The way add-on code registers listeners for events generated by API objects has changed. When constructing an object like a Panel, it remains possible to register event listeners by passing the constructor an option (like onShow for Panel objects). After construction, however, and for preexisting objects like the set of tabs exported by the Tabs API, you register a listener by calling the object's on method, passing it the name of the event and the listener function.
The value of the this object in event listeners has been made consistent. It is the object that emitted the event. For example, when a Panel object emits a show event, the value of the this object in its listeners is the Panel object.
cfx Tool
- The undocumented
xpcomcommand has been removed, along with its associated options--srcdirand--objdir. (bug 614568) - The
--dep-testsoption has been renamed to--dependencies. (bug 614129) - The shortcuts for some options have been removed or changed. (bug 614129)
- Shortcuts removed:
-pfor--pkgdir-kfor--extra-packages-tfor--templatedir-rfor--use-server-ufor--update-url-lfor--update-link-dfor--dep-tests-xfor--times
- Shortcuts changed:
-Pto-pfor--profiledir-Fto-ffor--filter
- Shortcuts removed:
- The
sdocs,testcfx,testpkgs, andtestexcommands and the--logfile,--profile-memory,--e10s,--keydir,--addons, and--test-runner-pkgoptions have been explicitly identified as internal (intended for use by developers working on the SDK itself) and might be changed or removed in the future. (bug 614128, bug 614130) - The
developcommand and--use-serveroption have been explicitly identified as experimental and might be changed or removed in the future. (bug 614130)
Miscellaneous API
- The
Tab.locationproperty has been renamed toTab.url, and its data type has changed tostring. (bug 612678) - The data type of the
contentURLproperty of Page, Panel, and Widget objects has changed tostring. - The
Tab.thumbnailproperty has been replaced by aTab.getThumbnail()method. (bug 612681) - The
contentScriptURLproperty of several objects has been renamed tocontentScriptFile. (bug 612716) - The Windows API's
openWindow()method has been renamed toopen(), and itsonReadyoption has been removed. (bug 612758, bug 612685) - Boolean properties have been prefixed with "is", including the Private Browsing API's
isActive, the Selection API'sisContiguous, andTab.isPinned. (bug 612733, bug 612735, bug 615164) - Private Browsing activation and deactivation is now exposed via
activate()anddeactivate()methods. - Tab pinning and unpinning is now exposed via
pin()andunpin()methods. - The localization (l10n) API has been removed. (bug 612770)
Miscellaneous
- The
jetpack-corepackage has been renamed toapi-utils. (bug 613348) - Add-ons created with the SDK are now marked as compatible with Firefox 4.0b7 and the latest Firefox 4.0b8pre nightlies. (bug 613341)
A complete list of changes is available in the source code repository.
Known Issues
- Although the SDK is not compatible with Firefox 3.6,
cfx testandcfx runmay use Firefox 3.6 by default if you have it installed. To work around the problem, specify the location of the Firefox 4.0 beta binary with the--binaryoption. - A variety of tests are failing intermittently. (bug 606351)
Also see the complete list of known issues and requests for enhancement.
Feedback and Bug Reports
We'd love to hear any feedback you have regarding this release! You can post it to the discussion group or report a bug.