Firefox 121 release notes for developers
This article provides information about the changes in Firefox 121 that affect developers. Firefox 121 was released on December 19, 2023.
Changes for web developers
>HTML
- Lazy loading of
<iframe>elements is now supported, allowing developers to hint that particular<iframe>elements should only be loaded when (and if) they become visible. This can speed up initial load time by reducing the resources that need to be fetched on page load (some<iframe>elements may not need to be fetched at all). The hint can be provided via theloadingattribute on the<iframe>element, or in JavaScript usingHTMLIFrameElement.loading. (Firefox bug 1622090).
CSS
- The
text-wrapproperty has been updated with support for the valuesbalanceandstable. Thebalancevalue is used for short blocks of content, such as headings, and will make sure that the content is balanced and easy to read when spread over multiple lines. Thestablevalue makes sure that editable content does not reflow while the user is editing it (Firefox bug 1731541). - The
:has()selector, commonly referred to as the parent selector, is now supported. It allows developers to apply styles to an element based on related elements, e.g.,li:has(ul)will match a list which contains a sub-list, orh1:has(+ p)will match a heading with a paragraph directly after it. - The
text-indentCSS property now supports theeach-lineandhangingproperty values (Firefox bug 784648), allowing developers to more easily specify certain text indentation styles. Additionally, developers can now combine multipletext-indentproperty values for more creativity, e.g.,text-indent: 3em hanging each-line.
JavaScript
-
The
Promise.withResolvers()static method is now supported. This exposes theresolveandrejectcallback functions in the same scope as the returnedPromise, allowing code that resolves or rejects the promise to be defined after its construction (Firefox bug 1845586). -
Date.parse()now accepts several additional date formats:-
Year > 9999 for
YYYY-MMM-DDformat (e.g.,19999-Jan-01) (Firefox bug 1858851) -
MMM-DD-YYYY(e.g.,Jan-01-1970) (Firefox bug 1863489) -
Milliseconds for non-ISO date formats (e.g.,
Jan 1 1970 10:00:00.050) (Firefox bug 1863125) -
Day of week at the beginning of formats which were being rejected, such as:
Wed, 1970-01-01Wed, 1970-Jan-01
The day of week does not need to be correct, or a day of week at all; for example,
foo 1970-01-01works (Firefox bug 1617562).
-
-
Other
Date.parse()fixes:YYYY-M-DDandYYYY-MM-Dare no longer assumed GMT as an ISO dateYYYY-MM-DDwould be (Firefox bug 1783731).- Milliseconds for all formats are truncated after 3 digits, rather than being rounded (Firefox bug 746529).
APIs
- The
sendOrderproperty of theWebTransportSendStreaminterface is now supported, allowing the relative priority of outgoing WebTransport API bidirectional streams to be read and changed after the stream is created. Note that this cannot be used to modify the priority of unidirectional streams, as Firefox implements them asWritableStreaminstead ofWebTransportSendStream. (For more information see Firefox bug 1853444.)
DOM
HTMLInputElement.showPicker()now works for<input type="week">and<input type="month">elements on Android (Firefox bug 1853797).
WebAssembly
- WebAssembly now supports tail call optimization via new
return_callandreturn_call_indirectalternatives to thecallinstruction. This improves performance, reduces stack space usage, and enhances compatibility with programming languages that use tail calls. (Firefox bug 1846789).
WebDriver conformance (WebDriver BiDi, Marionette)
WebDriver BiDi
- Added the
browsingContext.contextDestroyedevent that is emitted when a browsing context is discarded (Firefox bug 1694390). - Added support for the
userActivationparameter for thescript.callFunctionandscript.evaluatecommands which allows evaluating JavaScript while emulating the user action. (Firefox bug 1845488). - Added support for the
defaultValuefield for thebrowsingContext.userPromptOpenedevent that allow users to retrieve the default value of prompts (Firefox bug 1851761). - Renamed the
viewportOptionsparameter for thebrowsingContext.captureScreenshotcommand toboxOptions(Firefox bug 1859258). - Removed the
scrollIntoViewparameter for thebrowsingContext.captureScreenshotcommand, in favor of theoriginparameter below (Firefox bug 1862649). - Added support for the
originparameter for thebrowsingContext.captureScreenshotcommand which allows defining the origin and bounds of the screenshot. The accepted values are"document"and"viewport"(Firefox bug 1840999). - When serializing
Windowobjects, the serialized value now contains acontextproperty set to the context id for theWindowobject which can also be exchanged with Marionette to reference specific windows and frames (Firefox bug 1841049). - Fixed a bug where serialization of a Node nested in a data structure (array, map, etc.) would fail (Firefox bug 1861000).
- Fixed a bug where the
browsingContext.navigatecommand could return an incorrect navigation id (Firefox bug 1861655).
Marionette
- Added support for serializing and deserializing
WindowandFrameobjects (Firefox bug 1274251).
Experimental web features
These features are newly shipped in Firefox 121 but are disabled by default. To experiment with them, search for the appropriate preference on the about:config page and set it to true. You can find more such features on the Experimental features page.
- Custom element state pseudo-class:
dom.element.customstateset.enabled -
Custom elements can expose their internal state via the
statesproperty as aCustomStateSet. A CSS custom state pseudo-class such as:--some-statecan match that element's state. (Firefox bug 1861466) showPicker()method for HTML select elements:dom.select.showPicker.enabled-
The
HTMLSelectElement.showPicker()method programmatically launches the browser picker for a<select>element, triggered by user interaction. (Firefox bug 1854112)
Changes for add-on developers
-
Fixed a bug that resulted in background pages not starting when a manifest.json
backgroundkey containsservice_workerandscriptsdeclarations (Firefox bug 1860304).Note: Incidentally, a change in Chrome 121 sees the
scriptsproperty ignored when specified with theservice_workerproperty. Previously, Chrome refused to load extensions containing both properties (Chromium bug 1418934). For more information, see Browser support of thebackgroundmanifest key.