Add-ons Update – Week of 2014/05/28

Jorge Villalobos

5

I post these updates every 3 weeks to inform add-on developers about the status of the review queues, add-on compatibility, and other happenings in the add-ons world.

The Review Queues

  • Most nominations for full review are taking less than 4 weeks to review.
  • 120 nominations in the queue awaiting review.
  • Most updates are being reviewed within 2 weeks.
  • 90 updates in the queue awaiting review.
  • Most preliminary reviews are being reviewed within 2 weeks.
  • 92 preliminary review submissions in the queue awaiting review.

If you’re an add-on developer and would like to see add-ons reviewed faster, please consider joining us. Add-on reviewers get invited to Mozilla events and earn cool gear with their work. Visit our wiki page for more information.

Firefox 29 Compatibility

This is a big one. The Firefox 29 compatibility update is here, and there are some additional posts explaining some of what’s new:

As usual we recommend using the Aurora and Beta branches to test your add-ons ahead of time.

Firefox 30 Compatibility

The Firefox 30 compatibility update is here. The automatic compatibility validations will be run shortly, so if you have an add-on that is marked as compatible with Firefox up to version 29.*, expect some messaging from us soon.

Add-on Compatibility for Firefox 30

Jorge Villalobos

10

Firefox 30 will be released on June 10th. Here’s the list of changes that went into this version that can affect add-on compatibility. There is more information available in Firefox 30 for Developers, so you should read that too.

General

XPCOM

Plugins

  • Implement plugin whitelist. This shouldn’t have an effect for extensions in general, but it’s worth pointing out. As it was announced a while ago, most plugins will require action from the user’s side in order to be activated, and developers have the option to request being added to the plugin whitelist. Major plugins like Adobe Flash are already whitelisted. If you use plugins as part of your add-on, we strongly recommend that you move to other alternatives as soon as possible.

SDK

New!

These aren’t really new developer features, but they’re a couple of bug fixed that don’t break compatibility and you might find useful.

Please let me know in the comments if there’s anything missing or incorrect on these lists. If your add-on breaks on Firefox 30, I’d like to know.

The automatic compatibility validation and upgrade for add-ons on AMO will happen soon, so keep an eye on your email if you have an add-on listed on our site with its compatibility set to Firefox 29.

Add-ons for Australis Contest Winners

Amy Tsay

28

The results are in for the Add-ons for Australis contest. The judges have selected the add-on entries that best capture Firefox 29’s new design and customization features, so check them out for yourselves! Congratulations to the winners!

Best Overall

1st Place – The Fox, Only Better

by quicksaver
Maximizes browser viewing space while keeping it user-friendly.

Absolutely magnificent. This add-on works like a charm and will not only give you back maximum browser screen space, it does it in very cool style.

2nd Place – Classic Theme Restorer

by Aris
Restore squared tabs, appmenu, add-ons bar, small button view and more in Firefox 29.

3rd Place – Profilist

by Noitidart
Inlays a simple and quick access profile manager into the new panel-based main menu. Designed for the Australis update to Firefox.

Best Bookmark

1st Place – QuickMark

by Martijn
QuickMark provides a lightning-fast way for creating bookmarks and keeping them organized. Create and place them in a folder in one mouse sweep or use the shortcuts so your hands won’t need to leave the keyboard.

I do a lot of Internet research reviewing and returning to specific web pages under changing topics – often bookmarking 20 out of 200 pages. I’ve gotten so tired of the normal process of getting to the bookmark dialog. Thank you so much for this simple, elegant and quick bookmarking tool.

2nd Place – Feed Sidebar

by Chris
The Feed Sidebar is an extension for Firefox that displays the items from your Live Bookmarks in the sidebar.

3rd Place – What about:

by petzichen
Type in “What about:” in your awesome bar to see a list of “About:” Firefox URLs.

Best Complete Theme

1st Place – Noia Fox

by David
An old favorite, completely updated for Firefox 29.

I use multiple Firefox profiles to organize my work as a coder. David Vincent’s Noia Fox theme + Noia Fox options is an integral part of that setup: I can skin each profile with a different persona while keeping the same basic look and feel.

2nd Place – MX3

by dkgo
Compact and elegant theme for Firefox 29.

3rd Place – Walnut for Firefox

by Alfred
Walnut for a wooden look and feel. Walnut is a complete skin redesign so that all windows, widgets, panels, and many extensions have a wooden look and feel.

Add-ons Update – Week of 2014/05/09

Jorge Villalobos

4

I post these updates every 3 weeks to inform add-on developers about the status of the review queues, add-on compatibility, and other happenings in the add-ons world.

The Review Queues

  • Most nominations for full review are taking less than 4 weeks to review.
  • 91 nominations in the queue awaiting review.
  • Most updates are being reviewed within 1 week.
  • 62 updates in the queue awaiting review.
  • Most preliminary reviews are being reviewed within 10 days.
  • 73 preliminary review submissions in the queue awaiting review.

If you’re an add-on developer and would like to see add-ons reviewed faster, please consider joining us. Add-on reviewers get invited to Mozilla events and earn cool gear with their work. Visit our wiki page for more information.

Firefox 29 Compatibility (Australis!)

This is a big one. The Firefox 29 compatibility update is here, and there are some additional posts explaining some of what’s new:

As usual we recommend using the Aurora and Beta branches to test your add-ons ahead of time.

Contest

The Add-ons for Australis contest went very well, and we already chose the winners! Expect the announcement on this blog early next week.

May Featured Add-ons

Amy Tsay

Pick of the Month: Easy Copy

Copy page details such as its title, URL and HTML source with one click and paste it anywhere, such as emails, blogs and forums. Copy a single page, all open tabs or all links on a page. Format text as plain text or HTML.

This is an excellent add-on, bringing in unlimited possibilities. It can be used for all sorts of clippings, and it brings value to other add-ons in the Firefox universe. For instance you can select some text and save it as a Zotero or Scrapbook note, all source info retained without the need to save the entire page.”

Get Easy Copy »

Also Featured

Lightweight Themes Manager
Manage your installed personas (lightweight themes). Get it now »

CookieKeeper
Extended Cookie Manager—keep only wanted cookies. Get it now »

Ecosia – The search engine that plants trees!
Ecosia is a search engine that donates 80% of its income to a tree-planting program in Brazil. By searching with Ecosia, you can help the environment for free. Get it now »

Nominate your favorite add-ons!

Featured add-ons are selected by a community board made up of add-on developers, users, and fans. Board members change every six months, so there’s always an opportunity to participate. If you’re interested, please apply by Tuesday, May 6, 2014 at 23:59 PDT. More details >

If you’d like to nominate an add-on for featuring, please send it to amo-featured@mozilla.org for the board’s consideration. We welcome you to submit your own add-on!

Apply to be on the next Featured Add-ons Board

Amy Tsay

1

It’s time to choose new members for the featured add-ons board! Board members are responsible for deciding which add-ons are featured on AMO in the next six months. Downloads of featured add-ons grow exponentially in the months they are featured, so your participation really makes an impact. Also, featured add-ons help users discover what’s new and useful.

Anyone from the add-ons community is welcome to apply: power users, theme designers, developers, and evangelists. Priority will be given to applicants who have not served on the board before, followed by those from previous boards, and finally from the outgoing board. This page provides more information on the duties of a board member.

To be considered, please email us at amo-featured@mozilla.org with your name, and tell us how you’re involved with AMO. The deadline is Tuesday, May 6, 2014 at 23:59 PDT. The new board will be announced about a week after.

We look forward to hearing from you!

Add-ons Update – Week of 2014/04/16

Jorge Villalobos

12

I post these updates every 3 weeks to inform add-on developers about the status of the review queues, add-on compatibility, and other happenings in the add-ons world.

The Review Queues

  • Most nominations for full review are taking less than 3 weeks to review.
  • 148 nominations in the queue awaiting review.
  • Most updates are being reviewed within 2 weeks.
  • 118 updates in the queue awaiting review.
  • Most preliminary reviews are being reviewed within 2 weeks.
  • 142 preliminary review submissions in the queue awaiting review.

If you’re an add-on developer and would like to see add-ons reviewed faster, please consider joining us. Add-on reviewers get invited to Mozilla events and earn cool gear with their work. Visit our wiki page for more information.

Firefox 29 Compatibility (Australis!)

This is a big one. The Firefox 29 compatibility update is here, and there are some additional posts explaining some of what’s new:

As usual we recommend using the Aurora and Beta branches to test your add-ons ahead of time.

The Add-ons for Australis contest is now closed, and we have begun the judging phase. We will announce the winners on this blog in a couple of weeks. Good luck!

Add-on Compatibility for Firefox 29

Jorge Villalobos

23

Firefox 29 will be released on April 29th. Here’s the list of changes that went into this version that can affect add-on compatibility. There is more information available in Firefox 29 for Developers, so you should read that too.

Australis!

This is an actual movie

Yes, this is a joke.

This is a big one. The Australis theme introduces major changes that all add-on developers should be aware of, but it’s nowhere nearly as dramatic as initially thought. We’ve already been blogging about it extensively, so please give these articles a read if you haven’t already:

Notable changes include the removal of the add-on bar and the Firefox button on Windows, the introduction of the menu panel, and an overhaul in the toolbar customization system. Toolbars are no longer hidden for about: pages, there’s no small/large button setting anymore, and tabs are always on top.

Make sure you test your add-on extensively, paying special attention to button customization.

If you notice any problems in your add-ons related to Australis, please file a bug and add it as a dependency to one of these bugs:

  • Add-on issues. This is for add-ons that haven’t been updated yet and are visually broken in Firefox 29 and above.
  • Australis add-on bugs. Use this one if something is broken in your add-on and you believe it’s a bug in the new code.

General

XPCOM

New!

Please let me know in the comments if there’s anything missing or incorrect on these lists. If your add-on breaks on Firefox 29, I’d like to know.

The automatic compatibility validation and upgrade for add-ons on AMO will happen soon, so keep an eye on your email if you have an add-on listed on our site with its compatibility set to Firefox 28.

Changes to unsafeWindow for the Add-on SDK

wbamberg

25

In Firefox 30 the Add-on SDK is making a change to the execution environment for content scripts. While this change will not affect most add-ons, some patterns will no longer work. Specifically, content scripts will no longer be able to use unsafeWindow or window.wrappedJSObject to make JavaScript objects available to content. The more common pattern of accessing objects in the page directly via unsafeWindow will continue to work as expected.

What we’re introducing instead are some new APIs that you can use to share functions and objects with content explicitly. While you’re working on migrating to these new APIs, there’s a mechanism you can use to switch your add-on back to the old behavior as a short-term measure.

Who’s affected?

Add-on SDK-based add-ons that use unsafeWindow or window.wrappedJSObject in content scripts to share JavaScript objects with the scripts loaded by a web page will be broken by this change.

By default, content scripts and the scripts loaded into web pages are insulated from each other. They can both see the DOM, but content scripts can’t access objects defined by page scripts, and page scripts can’t access objects defined by content scripts:

// content-script.js
var button = document.getElementById("show-page-script-var");
button.addEventListener("click", function() {
  // access object defined in page script
  console.log(window.pageScriptObject.greeting);        // undefined
}, false);
 
window.contentScriptObject = {"greeting" : "hello from add-on"};
// page-script.js
var button = document.getElementById("show-content-script-var");
 
button.addEventListener("click", function() {
  // access object defined by content script
  console.log(window.contentScriptObject.greeting);     // undefined
}, false);
 
// define object to be accessed by content script
window.pageScriptObject = {"greeting" : "hello from web page"};

Sometimes a content script wants to break through this insulation, and to do that it can use unsafeWindow (or window.wrappedJSObject, which is identical):

// content-script.js
var button = document.getElementById("show-page-script-var");
button.addEventListener("click", function() {
  // access object defined in page script
  console.log(unsafeWindow.pageScriptObject.greeting);  // "hello from web page"
}, false);
 
unsafeWindow.contentScriptObject = {"greeting" : "hello from add-on"};
// page-script.js
var button = document.getElementById("show-content-script-var");
 
button.addEventListener("click", function() {
  // access object defined by content script
  console.log(window.contentScriptObject.greeting);     // "hello from add-on"
}, false);
 
window.pageScriptObject = {"greeting" : "hello from web page"};

From Firefox 30 onwards, this mechanism won’t work any more to share objects from the content script to the page script:

// content-script.js
var button = document.getElementById("show-page-script-var");
button.addEventListener("click", function() {
  // access object defined in page script
  console.log(unsafeWindow.pageScriptObject.greeting);  // "hello from web page"
}, false);
 
unsafeWindow.contentScriptObject = {"greeting" : "hello from add-on"};
unsafeWindow.contentScriptPrimitive = 42;
// page-script.js
var button = document.getElementById("show-content-script-var");
 
button.addEventListener("click", function() {
  // access primitive defined by content script
  console.log(window.contentScriptPrimitive);            // 42
  // access object defined by content script
  console.log(window.contentScriptObject.greeting);     // undefined
}, false);
 
window.pageScriptObject = {"greeting" : "hello from web page"};

Again, the use of unsafeWindow to access variables defined in the page script is unaffected, so this change is asymmetric. Content scripts can still access page objects using unsafeWindow, but not vice versa.

Also note that the content script will still be able to share primitive values with the page using unsafeWindow, just not objects.

If the page script tries to read a variable defined using unsafeWindow, it will get the value undefined. If it tries to write to such a variable, the browser will throw an exception with this message: “Permission denied to access property [name of the property]”.

The workaround

In the short term, there’s a new option in package.json called “unsafe-content-script” under the “permissions” key. By setting it to true you can revert to the old behavior:

"permissions": {
  "unsafe-content-script": true
}

However, this is only a temporary fix to enable your add-on to keep working while you update to the new APIs. We will deprecate and eventually remove this flag.

The real fix

The real fix is to use three new APIs to share objects and functions with web content: cloneInto(), exportFunction(), and createObjectIn(). All three of these functions are made available to content scripts as globals.

cloneInto()

You can use cloneInto() to clone an object from the content script’s context into the page script’s context. cloneInto() creates a structured clone of the object in the target context, and returns a reference to the clone. You can then assign that to a property of the target window, and the page script can access it:

// content-script.js
contentScriptObject = {"greeting" : "hello from add-on"};
unsafeWindow.contentScriptObject = cloneInto(contentScriptObject, unsafeWindow);
// page-script.js
var button = document.getElementById("show-content-script-var");
 
button.addEventListener("click", function() {
  // access object defined by content script
  console.log(window.contentScriptObject.greeting);     // "hello from add-on"
}, false);

You can also assign the reference to an object you’ve created using createObjectIn():

var foo = createObjectIn(unsafeWindow, {defineAs: "foo"});
var contentScriptObject = {"greeting" : "hello from add-on"};
unsafeWindow.foo.contentScriptObject = cloneInto(contentScriptObject, unsafeWindow);
// page-script.js
var button = document.getElementById("show-content-script-var");
 
button.addEventListener("click", function() {
  // access object defined by content script
  console.log(window.foo.contentScriptObject.greeting); // "hello from add-on"
}, false);

exportFunction()

You can use exportFunction() to expose a function from a content script to a page script. In this way a function defined in a content script can be called by the page script. Any non-native arguments, and the return value, are cloned into the page script’s context.

You can export the function to the target’s window object:

// content-script.js
var salutation = "hello, ";
function greetme(user) {
  return salutation + user;
}
 
exportFunction(greetme, unsafeWindow, {defineAs: "greetme"});
// page-script.js
var button = document.getElementById("call-content-script-function");
 
button.addEventListener("click", function() {
  console.log(window.greetme("page script"));           // "hello, page script"
}, false);

You can also export the function to an object you’ve created in the page context using createObjectIn(). This code creates a new object in the page’s context called foo, and attaches the greetme() function to that object:

// content-script.js
var salutation = "hello, ";
function greetme(user) {
  return salutation + user;
}
 
var foo = createObjectIn(unsafeWindow, {defineAs: "foo"});
exportFunction(greetme, foo, {defineAs: "greetme"});
// page-script.js
var button = document.getElementById("call-content-script-function");
 
button.addEventListener("click", function() {
  console.log(window.foo.greetme("page script"));
}, false);

createObjectIn()

You can use createObjectIn() to create a new object in the page script’s context. You can then export objects and functions to that object, instead of the target scope’s global window. See the previous sections for some examples of this.

Structured cloning

These functions use the structured clone algorithm to clone objects into the page context. This is more capable than JSON serialization, but still has some serious limitations. Most notably, you can’t clone functions, so you can’t export functions that take functions as arguments (such as callbacks) and functions that return functions. However, we’re working on adding better support at least for common patterns like callbacks.

More details

To learn more about the new APIs see the reference documentation:

If you have any questions, please ask in the Jetpack mailing list or the #jetpack channel on irc.mozilla.org.