files/en-us/mozilla/firefox/releases/121/index.md
This article provides information about the changes in Firefox 121 that affect developers. Firefox 121 was released on December 19, 2023.
<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 the loading attribute on the <iframe> element, or in JavaScript using {{domxref("HTMLIFrameElement.loading")}}.
(Firefox bug 1622090).balance and stable. The balance value 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. The stable value makes sure that editable content does not reflow while the user is editing it (Firefox bug 1731541).li:has(ul) will match a list which contains a sub-list, or h1:has(+ p) will match a heading with a paragraph directly after it.text-indent CSS property now supports the each-line and hanging property values (Firefox bug 784648), allowing developers to more easily specify certain text indentation styles. Additionally, developers can now combine multiple text-indent property values for more creativity, e.g., text-indent: 3em hanging each-line.The {{jsxref("Promise.withResolvers()")}} static method is now supported. This exposes the resolve and reject callback functions in the same scope as the returned {{jsxref("Promise")}}, allowing code that resolves or rejects the promise to be defined after its construction (Firefox bug 1845586).
{{jsxref("Date.parse()")}} now accepts several additional date formats:
Year > 9999 for YYYY-MMM-DD format (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-01The day of week does not need to be correct, or a day of week at all; for example, foo 1970-01-01 works (Firefox bug 1617562).
Other {{jsxref("Date.parse()")}} fixes:
YYYY-M-DD and YYYY-MM-D are no longer assumed GMT as an ISO date YYYY-MM-DD would be (Firefox bug 1783731).<input type="week"> and <input type="month"> elements on Android (Firefox bug 1853797).return_call and return_call_indirect alternatives to the call instruction. This improves performance, reduces stack space usage, and enhances compatibility with programming languages that use tail calls. (Firefox bug 1846789).browsingContext.contextDestroyed event that is emitted when a browsing context is discarded (Firefox bug 1694390).userActivation parameter for the script.callFunction and script.evaluate commands which allows evaluating JavaScript while emulating the user action. (Firefox bug 1845488).defaultValue field for the browsingContext.userPromptOpened event that allow users to retrieve the default value of prompts (Firefox bug 1851761).viewportOptions parameter for the browsingContext.captureScreenshot command to boxOptions (Firefox bug 1859258).scrollIntoView parameter for the browsingContext.captureScreenshot command, in favor of the origin parameter below (Firefox bug 1862649).origin parameter for the browsingContext.captureScreenshot command which allows defining the origin and bounds of the screenshot. The accepted values are "document" and "viewport" (Firefox bug 1840999).Window objects, the serialized value now contains a context property set to the context id for the Window object which can also be exchanged with Marionette to reference specific windows and frames (Firefox bug 1841049).browsingContext.navigate command could return an incorrect navigation id (Firefox bug 1861655).Window and Frame objects (Firefox bug 1274251).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.
dom.element.customstateset.enabled
:--some-state can match that element's state. (Firefox bug 1861466)showPicker() method for HTML select elements: dom.select.showPicker.enabled
Fixed a bug that resulted in background pages not starting when a manifest.json background key contains service_worker and scripts declarations (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.