The Per-Window Private Browsing Plan
Due to Per-Window Private Browsing (Bug 463027) there will need to be substantial changes to the Add-on SDK.
The Add-on SDK team is tasked with making it easy to make add-ons. One way we achieve this is by abstracting away the Gecko platform’s complexity, and saving add-on developers from platform changes from one version of Firefox to the next, but this won’t always be possible and per-window private browsing is one of those changes that we won’t be able to abstract away to the point that upgrading an add-on that was based on version 1.13 or earlier to v1.14 would be possible.
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.
For the Add-on SDK this means the private-browsing module’s old events (
stop), methods (
deactivate), and attribute (
isActive) won’t do anything. The latter two will be around and simply throw depcrecation errors if one tries to use them. There will also be a new event
exited which will fire when the last private browsing window is closed, and a new method
isPrivate which one can pass a tab, window, page-mod worker instance, and perhaps some other argument types will need to be supported as well to make development life easier. For intance one could get the tab for a page-mod worker instance and call
isPrivate(worker.tab) instead of
isPrivate(worker) but the latter is clearly easier to understand.
The big problem lies in the fact that we can’t simply upgrade add-ons from the SDK v1.13 to v1.14 but we still don’t want to be in a situation where developers are either forced to do a bunch of work to support the SDK v1.14 and Firefox 20+ in turn, or their add-on no longer works on the latest version of Firefox! So we’ve decided that by default add-ons made with SDK will no longer work in private windows, and inorder to support private browsing windows a developer will have to include a
"private-browsing": true flag in their add-on’s
This way we still can upgrade add-ons, and give developers some time to support this new feature.
Watch for these changes in our weekly beta releases!