Labs/Jetpack/Release Notes/1.11

From MozillaWiki
Jump to: navigation, search


The Add-on SDK is a software development kit that provides a set of tools and APIs for building, testing, and packaging Firefox add-ons.


Obtain the SDK in your favorite compression format:

Then unpack the archive, open the addon-sdk-1.11/README.txt file, and follow its instructions.

Major Changes Since 1.10

New features for page-mod

In this release we've added several new features to page-mod. You can now:

  • choose to attach content scripts to tabs that are already open when the page-mod is created
  • choose to attach a content script to:
    • the topmost document and any frames it contains
    • only the topmost document
    • only frames.

We've also stopped page-mod from attaching content scripts to documents that arent hosted in tabs, such as the widget or panel's documents.

Blog posts:

Bug references:

Updated page-mod documentation: Page-mod API Reference.

Deprecation of private-browsing's activate() and deactivate() functions

Firefox is planning to introduce per-window private browsing. In this implementation, the choice about whether a window is in private mode or not is made at the time the window is opened and cannot be changed afterwards.

Because of this, the activate and deactivate functions in the private-browsing module will not make sense any more. We're deprecating these functions in SDK 1.11. They will continue to work, but will generate warnings.

When the SDK is used with versions of Firefox which implement per-window private browsing, these functions will no longer do anything. We don't expect this to happen before SDK 1.13 at the earliest, which is due to ship in January 2013.

See the private-browsing API reference.

Removal of content-proxy

We've removed the custom proxy implementation for content scripts. These proxies were needed to work around bugs in XRayWrappers, but as the bugs are now fixed we don't need them any more and can use XRayWrappers directly.

This should not affect functionality, but should improve performance when accessing the DOM from a content script.

Bug reference:

Preferences localization

We've added localization support for your add-on's preferences. See Using Localized Strings in Preferences.

Major bug fixes

Known Issues

See the complete list of known issues and requests for enhancement. We've listed some of the issues you're most likely to encounter separately below.

Bug 804935

"TypeError: window.tabs is undefined" when opening a tab, in some circumstances.

Bug 787345

In a content script, adding an event listener to window by assignment doesn't work:

 window.onclick = function() {
   window.alert("You clicked me 1");

Bug 785914

The Google Analytics script does not register page views made using SDK objects such as panel and page-worker, because cookies are set incorrectly.

Bug 769709

The context-menu's SelectionContext does not always fire in iframes.

Bug 752775

Use of the deprecated global postMessage() function in a content script will give the error "ReferenceError: console is not defined".

Bug 731074

console.log() calls from a script included in a panel's HTML (as in this example: don't work: nothing is logged, either to the terminal console or the web console.

Bug 707623

Some keyboard events are fired twice on some elements inside a panel.

Bug 700733

Selection Context Menu Item throws error on right-click of form button.

Bug 717183

Specified panel width ignored when Firefox is maximized.

Bug 714914

Items of context-menu module appear only after successful page load. While the page is still loading they don't appear.

This behavior is by design because the worker for an item-window pair is created when the window finishes loading. Until a worker is created, context-menu can't tell whether the item should be shown or not, so the item isn't shown until the worker is created.

If context-menu supported contentScriptWhen like page-mod does, this could probably be done by setting it to "start". Right now consumers are effectively locked in to "ready".

Bug 714181

Access to Full Screen API blocked from context-menu API.

Bug 726796 function "crashes" with some profiles.

Bug 667817

If you change location in a content script using: window.location=""; Nothing happens, instead, `location` attribute is just replaced by a string.

Bug 684047

If a page-mod matches a page, its content scripts get attached to every iframe in the page, and this can have a bad effect on performance if the script is large and the page contains many iframes.

Although this behaviour is intentional, there should be an option to make content scripts only run on the topmost frame of a page.

Bug 701760

When an html select element (e.g. a drop-down menu) in web content inside a panel has focus, clicking *outside* the panel does not close the panel.

Bug 700733

If you create a context menu item for the selection type, and right-click a form button, the context menu does not appear and an error is logged. It's not yet clear whether this is specific to form buttons or not.

Bug 689215

The tab array is not reordered to match the on-screen order of the tabs after a tab move event takes place.

Bug 663048

The SDK will give an error if your package name contains spaces or Unicode characters.

Bug 627432

If your add-on stores data using the simple-storage API, the data is not cleaned up when your add-on is uninstalled.

Bug 571049

If an add-on is uninstalled while it's disabled, it's not notified of uninstall. If the add-on needs to do some special cleanup on uninstall, like removing persistent storage such as a file, this won't be possible if it has been disabled.

Bug 660862

By default, widgets are placed on the add-on bar, and given a height to match the height of that bar. If the user moves the widget to a different toolbar, and that toolbar has a different height, the widget's height is not updated accordingly.

Bug 660857

A widget containing HTML content gets no icon in the Customize Toolbar Window.

Bug 660860

When a user removes a widget from the toolbar its detach event does not get sent.

Bug 661884

Selection events for a page are not sent if the page did not fully load (for example, because the user stopped the page loading).

Bug 556562

If you have copy of mozrunner installed on your system, the cfx test command may not work correctly.

There is a workaround for this.

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.