recursal/MDN huggingface dataset:
Updating extensions for Firefox 3.6
===================================

This article provides helpful information to extension developers trying to update their extensions to work properly in Firefox 3.6.

User interface changes
----------------------

Right-clicking on elements (including links and images) no longer offers a "Properties" menu item. The properties dialog box was not useful for most users and has been removed. If your extension interacts with that menu item in any way, you'll need to revise your code to add it yourself, or contribute your own context menu entry directly.

Add-on package changes
----------------------

In order to allow add-ons' icons to be displayed even when they're disabled, Gecko 1.9.2 added support for automatically detecting and using an icon named `icon.png`, located in the add-on's root directory. This is used if the add-on is disabled, or if the manifest is missing an `iconURL` entry.

HTML 5 compliance improvements
------------------------------

The DOM Level 2 views to HTML and XHTML documents are now unified per HTML 5.

* The `localName` DOM property now returns the name of HTML element nodes in lower case. Previously, in HTML documents, it returned it in upper case. (DOM Level 1 `tagName` continues to return in upper case in HTML documents.)
* The `namespaceURI` DOM property now returns `"http://www.w3.org/1999/xhtml"` on HTML element nodes. Previously, in HTML documents, it returned `null`.
* `document.createElementNS(null, "FOO")` no longer creates an HTML element node in HTML documents. `document.createElement("FOO")`
 or `document.createElementNS("http://www.w3.org/1999/xhtml", "foo")` continue
 to work in HTML documents.
* The `name` and the `local-name` functions in XPath returns the name of HTML elements in lower case. Previously, in HTML documents, they returned it in upper case.

The most probable upgrade problem is the pattern `if (elt.localName === "FOO")`.

### Example: Testing if an element is an HTML img element

#### Firefox 3.6, both text/html and application/xhtml+xml

`if (elt.localName === "img" && elt.namespaceURI === "http://www.w3.org/1999/xhtml")`

#### Firefox 3.5 and 3.6, only extension-supplied text/html without foreign (e.g. SVG) script-inserted elements

`if (elt.tagName === "IMG")`

#### Firefox 3.5 and 3.6, both text/html and application/xhtml+xml

`if (elt instanceof HTMLImageElement)`

contents.rdf no longer supported
--------------------------------

Support for the obsolete `contents.rdf` method for registering chrome has been removed in Gecko 1.9.2, and is no longer supported by Firefox 3.6. This means that add-ons that use contents.rdf can no longer be installed.

Make sure you include a chrome.manifest in your XPI.

**Note:** Add-ons that are already installed using the old contents.rdf method for registering chrome will continue to function if already installed. Make sure that you test your add-on by actually removing and reinstalling it to ensure that the install works after updating it to use an install manifest.
Updating themes for Firefox 3.6
===============================

This article intends to help theme authors update Firefox-3.5-compatible themes for Firefox 3.6 compatibility.

Chrome registration change
--------------------------

`contents.rdf` is not supported anymore, you need to use `chrome.manifest` instead.

Emptytext styling
-----------------

XUL textboxes don't have the `empty` attribute anymore, but `isempty` instead. So instead of `textbox[empty="true"]`, you need to use `textbox[isempty="true"]`.

Right-to-left UI support
------------------------

The `[chromedir="rtl"]` and `[chromedir="ltr"]` selectors have been obsoleted and won't work anymore on most elements. Instead, you need to use the new `:-moz-locale-dir_rtl` and `:-moz-locale-dir_ltr` selectors. See also: Making sure your theme works with RTL locales.

Cross-platform tabbed browser styling
-------------------------------------

The tabbed browser implementation no longer has a Mac-specific `tabs-closebutton-box`; instead, all platforms use the same names to identify the components of the tab strip.

Full Screen toolbar button
--------------------------

There's a new Full Screen toolbar button available from the Customize Toolbar dialog.

See also
--------

* MozillaZine forum: Mozilla 1.9.2 / Firefox 3.6 theme changes
* Themes
* Building a theme
Updating extensions for Firefox 7
=================================

This article offers advice for add-on developers that want to update their extensions to work in Firefox 7. Fortunately, most of the changes are relatively minor in this release, and few add-ons should need significant changes to work in Firefox 7.

**Note:** For a complete list of developer-related changes in Firefox 7, see Firefox 7 for developers.

As always, you will need to recompile any binary components to make them compatible with Firefox 7.

XPCOM changes affecting compatibility
-------------------------------------

Most of the changes in this release are XPCOM interface removals, or removals of specific, obsolete APIs from interfaces.

### Removed interfaces

The following interfaces are the ones that were removed that will most likely impact extension developers:

* `nsIDOM3Node`
* `nsIDOM3TypeInfo`
* `schemaTypeInfo`
* `nsIDOMNSDocument`
* `nsIDOMDocumentStyle`

You can get a complete list of the removed interfaces in the Removed interfaces section of Firefox 7 for developers.

### Changed methods

A few interfaces have methods that have been changed:

`nsINavHistoryObserver` and `nsINavBookmarkObserver`

These have been changed to support Firefox Sync better by adding a new GUID parameter to several of their methods. JavaScript-based code shouldn't require any changes, since this is just the addition of a new, optional, parameter. However, binary components will need to be updated to take the new parameter into account.

`nsIDOMFile`

A number of non-standard methods have been removed from this interface. This affects the `File` object's `File.getDataAsUrl()` and `File.getAsBinary()` methods. However, this functionality can now be found in the standard `FileReader` object.

Other changes of note
---------------------

These changes won't affect compatibility (we weren't kidding when we said there weren't many changes that do in this release), but do add capabilities that are easy to take advantage of that might be of special use to you.

### Unloading JavaScript code modules

The new `Components.utils.unload()` method lets you unload JavaScript code modules previously loaded by calling `Components.utils.load()`. This can be particularly handy with restartless (bootstrapped) extensions, so that you can unload an old version of a code module when a new version of your add-on is installed.

### Inline preferences

You can now have preference options inline in the Add-on Manager window, which lets users configure your add-on without having to open a separate preference dialog box. There are limits to what types of configuration controls can be provided, but this is still very helpful — plus it works for restartless (bootstrapped) extensions.

See also
--------

* Firefox 7 for developers
* Add-ons Blog: Firefox 7 add-on compatibility
* XPCOM changes in Gecko 2.0
Security changes in Firefox 3.5
===============================


 This article covers security-related changes in Firefox 3.5.
Changes to chrome registration
------------------------------

A security hole was closed in order to prevent remote content to be used as chrome. This could impact any add-on that included a resource in their `chrome.manifest` file that referenced a file on the web.

Fixing this bug was accomplished by adding a new `URI_IS_LOCAL_RESOURCE` flag to the `nsIProtocolHandler` interface that indicates that the protocol is safe to register as chrome. Any add-on that creates its own protocol handler and tries to register it in its `chrome.manifest` file will have to use this flag in order to work correctly.

Private browsing
----------------

Firefox 3.5 implements private browsing, a mode in which cookies, history, and other potentially private information isn't saved permanently on the user's computer. Extensions and other add-ons may support the private browsing feature, detecting when it's in use so they can avoid saving private information while private browsing mode is enabled. See Supporting private browsing mode for details.

Plug-ins can detect whether or not private browsing mode is in effect by using the `NPN_GetValue()` function to check the current value of the `NPNVprivateModeBool` variable.

New certificate error handling
------------------------------

In previous versions of Firefox 3, SSL certificate errors resulted in the presentation of the standard network error page, `about:neterror`, in the browser window. Starting in Firefox 3.5, there is a new error page, `about:certerror`, which is displayed instead. The error URL is formatted like this:

`about:certerror?e=error&u=url&d=desc`

Embedders needing to provide custom certificate error pages can now do so by supplying their own `about:` page implementation, and setting the `security.alternate_certificate_error_page` preference to the appropriate page name (e.g. `"certerror`").

See also
--------

* Firefox 3.5 for developers
Security in Firefox 2
=====================

This article discusses changes that affect security in Firefox 2.

Weak ciphers disabled by default
--------------------------------

Firefox 2 disables SSLv2 and the weak "export" cipher suites (those with key lengths less than 64 bits) by default, in favor of SSLv3. This provides improved security.

The preferred encryption methods are `TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA` and `TLS_RSA_WITH_3DES_EDE_CBC_SHA`. Some servers refer to these as `SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA` and `SSL_RSA_WITH_3DES_EDE_CBC_SHA`.

If SSLv2 support must be enabled, it can be by setting the appropriate `security.ssl2.*` user preferences to `true`.

New features
------------

* Firefox 2 supports Elliptic Curve Cryptography in TLS. Support is presently limited to curves of 256, 384, and 521 (yes, 521) bits.
* Firefox 2 supports the TLS server name indication extension to facilitate secure connections to servers hosting multiple virtual servers on a single underlying network address, as per RFC 3546.
* When Firefox 2 makes an OCSP request to validate a web server's certificate, it now uses the proxy that has been configured for normal HTTP traffic.
Determining what ciphers are available
--------------------------------------

As always, you can find out what ciphers are supported — and which are enabled or disabled — by going to about:config and searching on "ssl" or "tls".

Security improved for the jar: protocol
---------------------------------------

In order to correct a potential security problem when using the `jar:` protocol, it's now necessary to serve JAR files with the MIME type `application/java-archive`. See Security and the jar protocol for further details.
Updating extensions for Firefox 2
=================================

This article provides information that will be useful to developers that wish to update their extensions to work properly under Firefox 2.

Step 1: Update the install manifest
-----------------------------------

The first step — and, for most extensions, the only one that will be needed — is to update the install manifest file, install.rdf, to indicate compatibility with Firefox 2.

Find the line indicating the maximum compatible version of Firefox (which, for Firefox 1.5, might look like this):


```bash
 <em:maxVersion>1.5.0.*</em:maxVersion>
```


Change it to indicate compatibility with Firefox 2:


```bash
 <em:maxVersion>2.0.0.*</em:maxVersion>
```


Then reinstall your extension.

Step 2: Update XUL overlays
---------------------------

Firefox 2 incorporates changes to the default skin. Additionally, some user interface elements have been changed or moved, and it's possible your extension may be affected by these, depending on what your XUL overlays do.

Look over the article Theme changes in Firefox 2 to learn what changes were made that may affect your extension's XUL overlays.

Step 3: Test
------------

Be sure to test your extension carefully on Firefox 2 before you release it to the public. The last thing you want is for the new version of your extension to be responsible for a rash of reports of problems with the just-released version of Firefox!

Step 4: Release
---------------

Update your extension's entry on http://addons.mozilla.org. This will ensure that users can find it.

In addition, if your extension provides an `updateURL` in the install manifest, be sure to update the update manifest so that the new version of your extension can be found automatically by Firefox. By doing this, the first time the user runs your extension after upgrading to Firefox 2, Firefox can offer to automatically install it for them.
Adding feed readers to Firefox
==============================

Starting with Firefox 2, Firefox has support for selecting different RSS or Atom feed readers to use when you try to read a feed. This article provides information about how to add support for additional readers not supported by default.

Adding a new web-based feed reader
----------------------------------

### Adding a feed reader from a web application

Support for adding feed readers from the web was removed from the HTML5 spec, and Firefox support is scheduled for removal in Firefox 62. 
Deprecated

In older versions, JavaScript code on the web can add a feed reader using the `navigator.registerContentHandler()` function, like this:


```js
navigator.registerContentHandler(
  "application/vnd.mozilla.maybe.feed",
  "https://www.example.com/?feed-feed=%s",
  "My Feed Reader",
);
```


Note that web content is limited to adding handler URLs which have the same origin as the page performing the call.

### Adding a new feed reader manually

Support for adding new feed readers was removed in Firefox 63. 
Deprecated
.

Prior to Firefox 63, to add support for a new web-based feed reader, you would need to add three new preferences:

`browser.contentHandlers.types.number.title`

The name of the feed reader.

`browser.contentHandlers.types.number.type`

For a feed reader, this should be "application/vnd.mozilla.maybe.feed".

`browser.contentHandlers.types.number.uri`

The URI of the feed reader. Use "%s" where the URL of the feed should be inserted.

`number` should be replaced with the next highest unique number that hasn't already been used. For example, if you want to add a new feed reader called "Easy Reader", and there are already defined content handlers with numbers 0 through 4, you should use a `number` of 5, like this:

* `browser.contentHandlers.types.5.title`: `Easy Reader`
* `browser.contentHandlers.types.5.type`: `application/vnd.mozilla.maybe.feed`
* `browser.contentHandlers.types.5.uri`: `http://www.theeasyreaderurl.com?feed=%s`

You can add these preferences by hand, by visiting `about:config`.

### Adding a new feed reader application

The easiest way to do this is to use the provided user interface, by using the Feeds panel in the Preferences (or Options, depending on your platform) window.
Updating add-ons for Firefox 6
==============================

This article provides an overview of the changes you may need to make to your add-ons in order for them to work properly in Firefox 6. You can find a complete list of developer-related changes in Firefox 6 in Firefox 6 for developers.

Do you need to do anything at all?
----------------------------------

If your add-on is distributed on addons.mozilla.org (AMO), it's been checked by an automated compatibility verification tool. Add-ons that don't use APIs that changed in Firefox 6, and have no binary components (which need to be recompiled for every major Firefox release), have automatically been updated on AMO to indicate that they work in Firefox 6.

So you should start by visiting AMO and looking to see if your add-on needs any work done at all.

**Note:** You should still test your add-on on Firefox 6, even if it's been automatically upgraded. There are edge cases that may not be automatically detected.

Once you've confirmed that you need to make changes, come on back to this page and read on.

UI changes
----------

The addition of the new Web Developer sub-menu in the Tools menu means that overlays that rely on the items that have been moved there will work differently than they used to. Your overlays will continue to work, but your items will not wind up where you expect them to. You should update your overlays to ensure that menu items go where you intend them to go.

Similarly, the order of menu items in the History and Bookmarks menus may also affect your add-on's overlays.

Binary component compatibility
------------------------------

A bug in Firefox 5 meant that binary components were not properly being rejected if they were built for a different version of Gecko. This is fixed in Firefox 6; if your add-on's binary components don't load, check to be sure you've rebuilt them against the Gecko 6 SDK.

Preferences
-----------

The `app.update.timer` preference was removed; you need to use the `app.update.timerMinimumDelay` preference instead.

Also, site-specific privacy preferences have been added. This will only impact add-ons that expect privacy related preferences (privacy, remember passwords, and so forth) being in the main preference window.

DOM changes
-----------

The `window.top` property is now read only. This will affect your add-on if you have an undeclared variable named `top` in a chrome script.

URL handling
------------

`javascript:` and `data:` URLs entered into the location bar no longer inherit the principal of the currently loaded page. This probably won't affect many add-ons but if you run code that uses these URLs you may want to double check that everything is working as expected.

Firefox bug 658949 changed how the hash (#) symbol is treated in data Ls which may break CSS stylesheets which contain such symbol if it is not escaped.

Interfaces
----------

A few interfaces that were deprecated or implementation details have been removed. If you rely on any of them, you need to revise your code.
Contact us
==========

Use the links below to get help, to keep up to date with add-ons news, and to give us feedback.

### Add-ons forum

Use the Add-ons Discourse forum to discuss all aspects of add-on development and to request help.

### Mailing lists

The **dev-addons mailing list** was retired on December 1, 2020. You can view the dev-addons archives to see past discussions about the WebExtensions API and addons.mozilla.org.

### Chat

Matrix is an open, lightweight protocol for decentralized, real-time communications. For information on how to join Mozilla's Matrix instance, refer to the Matrix page on MozillaWiki.

* Add-ons (support for extensions, themes, and the WebExtensions API)
* AMO (discussion around addons.mozilla.org)
### Report problems

#### Security vulnerabilities

If you discover an add-on security vulnerability, even if the add-on is not hosted on a Mozilla site, please notify us. We will work with the developer to correct the issue. Please report security vulnerabilities confidentially in Bugzillaor by emailing amo-admins@mozilla.com.

#### Bugs on addons.mozilla.org (AMO)

If you find a problem with the site, we'd love to fix it. Please file a bug report and include as much detail as possible.
User actions
============

Some WebExtension APIs perform functions that are generally performed as a result of a user action. For example:

* a browser action with a popup will display the popup when the user clicks it, but there's also a `browserAction.openPopup` API enabling an extension to open the popup programmatically.
* if an extension adds a sidebar, it is typically opened by the user via some part of the browser's built-in user interface, such as the View/Sidebar menu. But there's also a `sidebarAction.open` API enabling an extension to open their sidebar programmatically.

To follow the principle of "no surprises", APIs like this can only be called from inside the handler for a user action. User actions include the following:

* Clicking the extension's browser action or page action.
* Selecting a context menu item defined by the extension.
* Activating a keyboard shortcut defined by the extension (this only treated as a user action from Firefox 63 onwards).
* Clicking a button in a page bundled with the extension.

For example:


```js
function handleClick() {
  browser.sidebarAction.open();
}

browser.browserAction.onClicked.addListener(handleClick);
```


Note that user actions in normal web pages are not treated as user actions for this purpose. For example, if a user clicks a button in a normal web page, and a content script has added a click handler for that button and in that handler sends a message to the extension's background page, then the background page message handler is not considered to be handling a user action.

Also, if a user input handler waits on a promise, then its status as a user input handler is lost. For example:


```js
async function handleClick() {
  let result = await someAsyncFunction();

  // this will fail, because the handler lost its "user action handler" status
  browser.sidebarAction.open();
}

browser.browserAction.onClicked.addListener(handleClick);
```
Browser compatibility for manifest.json
=======================================

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Browser support for JavaScript APIs
Firefox workflow overview
=========================

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Firefox workflow prepare step graphic | Firefox workflow code step graphic | Firefox workflow publish step graphic | Firefox workflow enhance step graphic | Firefox workflow retire step graphic |
| * Choose a Firefox version for web extension development
* Choose your IDE or code editor
* Install web-ext
* Get familiar with the
 add-on policies and developer agreement
 | * Code your extension
* Run your extension withweb-ext run
 or
 about: debugging)
* Test persistent and restart features
* Debug with theAddon Debugging Window
 | * Package your extension withweb-ext build
* Create an
 addons.mozilla.org account
* Submit your extension
* Submit your source code
 (if required)
* Create an appealing listing
 | * Responded to Mozilla extension review
* Promote your extension
* Nominate your extension to be featured
* Update and improve your extension
 | * Retire your extension
 |

\* Or distribute your extension for sideloading, desktop apps, or in an enterprise.

**Have an extension you want to bring to Firefox?** We provide advice, guidelines, and tools to help making make porting straightforward. To get started, visit Porting a Google Chrome extension.
Developing WebExtensions for Thunderbird
========================================

You'll approach the coding of an extension for Thunderbird in the same way as you would for a Firefox extension; using a text editor or tool of your choice to write the code.

API differences
---------------

**Note:** See ReadTheDocs for Thunderbird specific WebExtension API documentation.

Being both Gecko based, Thunderbird supports many of the APIs Firefox supports, with some differences, see browser compatibility for manifest.json and browser support for JavaScript APIs for details.

See also
--------

* Introduction to Thunderbird Add-On development
* Thunderbird specific WebExtension API documentation
* Browser support for JavaScript APIs
* Browser compatibility for manifest.json