Firefox 101 for developers
==========================

This article provides information about the changes in Firefox 101 that will affect developers. Firefox 101 was released on May 31, 2022.

Changes for web developers
--------------------------

### HTML

No notable changes.

### CSS

* The `prefers-contrast` media feature that is used to detect whether the user has specified a preference for higher (`more`) or lower (`less`) contrast in the presentation of web content is now available by default. This feature now also lets users specify a set of colors to use for the contrast through the new `custom` value (Firefox bug 1656363).
* Three new viewport sizes have been introduced: small (`s`), large (`l`), and dynamic (`d`). These new sizes have added new viewport-percentage length units in addition to the existing ones - `vh`, `vw`, `vmax`, and `vmin`. The new viewport-percentage length units include `svh`, `lvh`, `dvh`, `svw`, `lvw`, `dvw`, `svmax`, `lvmax`, `dvmax`, `svmin`, `lvmin`, and `dvmin` (Firefox bug 1610815). Additionally, the units `vb` and `vi` are now supported by default (Firefox bug 1610815).
* Support for the `inline-size` value for the `contain` property has been added. For more information, see (Firefox bug 1755565).
### JavaScript

No notable changes.

### APIs

#### DOM

* `HTMLMediaElement.preservesPitch` is now supported without the `moz` prefix.
 `mozPreservesPitch` is now an alias of `preservesPitch`, but is deprecated, and may be removed in future releases (Firefox bug 1652950).
* `HTMLInputElement.showPicker()` is now supported, allowing the picker for an input element to be displayed when a user interacts with some other element, such as a button (Firefox bug 1745005).
* `DOMException` is now a serializable object, so it can be cloned with `structuredClone()` or copied between workers using `postMessage()` (Firefox bug 1561357).
* *Constructable stylesheets* are now supported, making it much easier to create reusable stylesheets for use with Shadow DOM.
 The update includes the addition of a `CSSStyleSheet()` constructor for creating new stylesheets, the `CSSStyleSheet.replace()` and `CSSStyleSheet.replaceSync()` methods that can be used to add/replace CSS rules in the sheet, and the `Document.adoptedStyleSheets` and `ShadowRoot.adoptedStyleSheets` properties that are used to share sheets to a document and its shadow DOM subtrees.
 See Firefox bug 1520690 for more information.

#### Media, WebRTC, and Web Audio

* AV1 codec parameters are now properly parsed in media support queries.
 This means that `MediaCapabilities.decodingInfo()`, `HTMLMediaElement.canPlayType()`, and `MediaSource.isTypeSupported()` will now accurately report support for playback for AV1 sources based on the provided codec parameters.
 `MediaCapabilities.decodingInfo()` will also use the information to accurately report on "efficient decoding" of AV1 videos.
 For more information, see Firefox bug 1757861.
* `maxFramerate` is now supported for setting the maximum framerate that can be used to send an encoding (in `RTCPeerConnection.addTransceiver()` and `RTCRtpSender.setParameters()`).
 Note that zero if a valid frame rate value, but is interpreted by Firefox as "no frame rate limit".
 For more information, see Firefox bug 1611957.

#### SVG

* SVG images in the Firefox UI that are styled using `prefers-color-scheme` will respect the `color-scheme` of the embedder (previously `prefers-color-scheme` ignored the `color-scheme` of the embedder and triggered off either the device or browser theme).
 This ensures that a favicon, for example, is always styled to match the theme of the elements that nest it, and not necessarily the (potentially different) theme of the device. (Firefox bug 1764354).
### WebDriver conformance (WebDriver BiDi, Marionette)

Starting with this release of Firefox the WebDriver BiDi protocol will be enabled by default. A WebDriver BiDi session can be requested by using WebDriver classic (geckodriver, Marionette) and setting the `webSocketURL` capability to `true` when creating a new WebDriver session. The same capability will then contain the WebSocket end-point for BiDi clients to connect to.

The following commands and events are available:

* Adds the `session` module including a partial implementation for the commands to globally subscribe (`session.subscribe`) to and unsubscribe (`session.unsubscribe`) from events, and the ability to create a direct WebDriver BiDi session (`session.new`) when not using WebDriver classic.
* Adds the `browsingContext` module including the commands to open a new tab or window (`browsingContext.create`) or close such one (`browsingContext.close`), retrieve open browsing contexts (`browsingContext.getTree`) and to navigate within a browsing context (`browsingContext.navigate`). There is also support for the event when a browsing context got created (`browsingContext.contextCreated`).
* Adds the `log` module including support for log events (`log.entryAdded`).

For more information, see the full bug list.

Changes for add-on developers
-----------------------------

* Addition of the `storage.StorageArea.onChanged` event that enables you to listen for changes in content in the `local` and `sync` storage areas (Firefox bug 1758475).
* Manifest V3 preview features:
    + Addition of the `scripting` API, which provides features to execute a script, insert and remove CSS, and manage the registration of content scripts (Firefox bug 1687764). This API is available to Manifest V3 extensions and takes over the execute script and insert and remove CSS features from the `tabs` API.
    + Addition of the `action` API, which takes over the features of the `browserAction` API in Manifest V3 extensions. Corresponding addition of the `"action"` manifest key and `_execute_action` special shortcut to the manifest `commands` key. Note that the `browserAction` API and `"browser_action"` manifest key are only available in Manifest V2 extensions.
    + The `"background"` manifest key property `"persistent"` can be set to `false` under the control of preferences: for Manifest V2, the `extensions.eventPages.enabled` preference, and in Manifest V3, the `extensions.manifestV3.enabled` preference.
    + Addition of the `"host_permissions"` manifest key, which is available for Manifest V3 extensions.
    + The content script execution environment has changed for Manifest V3 extensions:
        - Content scripts can no longer rely on host permissions to perform cross-origin requests. Cross-origin requests from content scripts are possible with CORS.
        - The `content` object (that offered `content.fetch`, `content.XMLHttpRequest`, and `content.WebSocket`) is removed from the content script execution environment.
Older versions
--------------

* Firefox 100 for developers
* Firefox 99 for developers
* Firefox 98 for developers
* Firefox 97 for developers
* Firefox 96 for developers
* Firefox 95 for developers
* Firefox 94 for developers
* Firefox 93 for developers
* Firefox 92 for developers
* Firefox 91 for developers
* Firefox 90 for developers
* Firefox 89 for developers
* Firefox 88 for developers
* Firefox 87 for developers
* Firefox 86 for developers
* Firefox 85 for developers
* Firefox 84 for developers
* Firefox 83 for developers
* Firefox 82 for developers
* Firefox 81 for developers
* Firefox 80 for developers
* Firefox 79 for developers
* Firefox 78 for developers
* Firefox 77 for developers
* Firefox 76 for developers
* Firefox 75 for developers
* Firefox 74 for developers
* Firefox 73 for developers
* Firefox 72 for developers
* Firefox 71 for developers
* Firefox 70 for developers