Firefox 120 for developers
This article provides information about the changes in Firefox 120 that affect developers. Firefox 120 was released on November 21, 2023.
Changes for web developers
HTML
- Support for the
media
attribute in the<source>
element has been reintroduced and expanded to include<audio>
and<video>
elements. This attribute was first added in Firefox 15 but was removed in Firefox 53 when its use was limited to<source>
element within<picture>
. With this release, themedia
attribute will be available in<source>
elements within<audio>
,<video>
, and<picture>
(Firefox bug 1836128).
CSS
- The
light-dark()
CSS Color function is now supported. This allows the setting of a colors for both light & dark without the need forprefers-color-scheme
media feature (Firefox bug 1856999). - The
lh
andrlh
line height units are now supported. These allow setting properties relative to the line height of an element, for example, precisely aligning background decoration with multiline text (Firefox bug 1310170).
Removals
- The non-standard
-moz-image-rect()
CSS function for clipping background images has been removed. First introduced in Firefox 4, this function was never standardized or implemented in other browsers (Firefox bug 1856999).
JavaScript
-
Date.parse()
now accepts several additional date formats:-
Numeric dashed dates which do not meet the formal ISO standard are now accepted (Firefox bug 1557650), including:
"01-12-1999"
(month first)"1999-1-5"
(single-digit month or day)"10000-01-12"
(year > 9999)"99-01-05"
or"01-05-99"
(2-digit year, year must be >31 if it comes first)"1999-01-05 10:00:00"
(space between date and time).
These dates will be parsed with behavior typical of other non-ISO dates, such as local time zone and month rollover (April 31 rolls over to May 1 since April 31 doesn't exist).
-
Requirements for characters directly following numbers have been loosened to accept new formats (Firefox bug 449921), including:
"DDMonYYYY"
"Mon.DD.YYYY"
"DD.Mon.YYYY"
"YYYY.MM.DD"
"Mon DD YYYY hh:mmXm"
(am
/pm
directly following time)
-
Timezone
'Z'
is now accepted for non-ISO formats (e.g.Jan 1 1970 10:00Z
) (Firefox bug 1852422)
-
HTTP
- The
103 Early Hints
HTTP informational response status code is enabled for preconnecting to a particular origin (that the page is likely to need resources from). For more details see Firefox bug 1858712. - Firefox supports the Global Privacy Control
Sec-GPC
request header, which may be sent to indicate that the user does not consent to a website or service selling or sharing their personal information with third parties. Users can enable the header, in both normal and private browsing modes, by setting the preferenceprivacy.globalprivacycontrol.enabled
totrue
(inabout:config
). TheNavigator.globalPrivacyControl
andWorkerNavigator.globalPrivacyControl
properties allow JavaScript to check the user consent preference (Firefox bug 1856029).
APIs
- The
authenticatorAttachment
property of thePublicKeyCredential
interface is now supported. This allows web application client and server code to configure itself based on whether the authenticator is part of the device running web authentication, or can roam between devices (see Firefox bug 1810851). - The Minimum PIN Length Extension (
minPinLength
) of the Web Authentication API is supported, allowing a relying party server to request the authenticator's minimum PIN length during creation/registration (Firefox bug 1844450). - The
Navigator.userActivation
property andUserActivation
interface are now supported. These can be used to check whether the user is interacting with the page, or has interacted with it since page load (see Firefox bug 1791079). - The
PointerEvent.getCoalescedEvents()
method is restricted to use in secure contexts only (Firefox bug 1858434).
WebDriver conformance (WebDriver BiDi, Marionette)
WebDriver BiDi
- Added serialization support for
Proxy
andGenerator
objects (Firefox bug 1841786). - Added
authChallenges
property (the list of authentication challenges present in the headers), toresponseStarted
andresponseCompleted
network events, which will be useful in order to handle the upcomingnetwork.authRequired
event (Firefox bug 1855149).
Changes for add-on developers
- Although
PointerEvent.getCoalescedEvents()
has been restricted to secure contexts (Firefox bug 1858434), content scripts can use this method in documents that aren't a secure context (Firefox bug 1870498).
Older versions
- Firefox 119 for developers
- Firefox 118 for developers
- Firefox 117 for developers
- Firefox 116 for developers
- Firefox 115 for developers
- Firefox 114 for developers
- Firefox 113 for developers
- Firefox 112 for developers
- Firefox 111 for developers
- Firefox 110 for developers
- Firefox 109 for developers
- Firefox 108 for developers
- Firefox 107 for developers
- Firefox 106 for developers
- Firefox 105 for developers
- Firefox 104 for developers
- Firefox 103 for developers
- Firefox 102 for developers
- Firefox 101 for developers
- 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