Chrome 104 Beta: New Media Query Syntax, Region Capture, and More
Media Queries Level 4 Syntax and Evaluation
Media Queries enable by around 80% of sites that use media queries.
The Media Queries Level 4 specification includes a new syntax for these range queries. They can now be written using ordinary mathematical comparison operators. Also supported are the logical operators or and not, and nesting and evaluation of "unknown" features. For example, a media query previously written like this:
@media (min-width: 400px) { … }
Can now be written like this:
@media (width >= 400px) { … }
For more information, see New syntax for range media queries in Chrome 104.
Origin Trials
This version of Chromium supports the origin trials described below. Origin trials allow you to try new features and give feedback on usability, practicality, and effectiveness to the web standards community. To register for any of the origin trials currently supported in Chromium, including the ones described below, visit the Microsoft Edge Origin Trials Developer Console.
New Origin Trials
Focusgroup
The focusgroup CSS property improves keyboard focus navigation using the keyboard arrow keys among a set of focusable elements. Adding this feature to browsers allows web developers to control focus navigation without custom solutions that can lead to a lack of consistency, accessibility, and interoperability. Sign up here for the Microsoft Edge origin trial. It's scheduled to last through 107.
Opt Out of Credit Card Storage
Secure Payment Confirmation now supports a means for users to opt out of storing their credit card data to make later purchases easier. To use the new feature, set showOptOut to true on methodData.data, which is passed as the first parameter of the PaymentRequest() constructor. For example:
const methodata = [{
…
data: {
…
showOptOut: true
…
}
}];
const request = new PaymentRequest(methodData, details);
To see an example in context sign up here for the origin trial. It's scheduled to last through Chrome 106.
Shared Element Transitions
Shared Element Transitions enables the creation of polished transitions in single-page applications (SPAs). Minimal development effort is required by devs to make transitions look nice; they can choose to use default animation properties, or they can customize their own transition effects to achieve the desired transition experience.Transitions are set declaratively using CSS properties. For more information, see sign up for the origin trial.
Completed Origin Trials
The following features, previously in a Chrome origin trial, are now enabled by default.
Speculation Rules
Speculation rules provide a mechanism for web content to permit prefetching or prerendering of certain URLs. For example:
<script type="speculationrules">
{
"prefetch": [
{"source": "list", "urls": ["/weather/kitchener", "/weather/seattle", "/weather/tokyo"]}
]
}
</script>
Subresource Loading with Web Bundles
Subresource loading with web bundles is a way to load many resources efficiently. To use the feature a web page declares that certain resources are provided by a web bundle at a particular URL. For example:
<script type="webbundle">
{
"source": "https://example.com/dir/subresources.wbn",
"resources": ["https://example.com/dir/a.js", "https://example.com/dir/b.js", "https://example.com/dir/c.png"]
}
</script>
For information on creating web bundles, see Origin Trial for Subresource Loading with Web Bundles.
Other Features in this Release
Cookie Expires/Max-Age Attribute Upper Limit
When cookies are set with an explicit Expires/Max-Age attribute change in the spec.
400 days was chosen as a round number close to 13 months. This duration ensures that sites visited roughly once a year (for example, sites for choosing health insurance benefits) will continue to work.
CSS object-view-box
The First Look At The CSS object-view-box Property.
Fullscreen Capability Delegation
general delegation mechanism that shipped in Chrome 100.
Multi-Screen Window Placement: Fullscreen Companion Window
Fullscreen Companion Window allows sites to place fullscreen content and a popup window on separate screens from a single user activation. There is a source code on GitHub.
Permissions Policy for Web Bluetooth API
Web Bluetooth is now controllable with a Permissions Policy. The token is named "bluetooth" and has a default allowlist of 'self'.
visual-box on overflow-clip-margin
The overflow-clip-margin property specifies how far an element's content is allowed to paint before being clipped. This feature allows using visual-box values to configure the reference box that defines the overflow clip edge the content is clipped to.
Web Custom Formats for Async Clipboard API
Web Custom Formats lets websites read and write arbitrary unsanitized payloads using a standardized web custom format, as well as read and write a limited subset of OS-specific formats (for supporting legacy apps).
The name of the clipboard format is mangled by the browser in a standardized way to indicate that the content is from the web. This allows platform applications to opt-in to accepting the unsanitized content.
Some web app developers want to exchange data payloads between web and platform applications via operating system clipboards. The Clipboard API supports the most popular standardized data types (text, image, rich text) across all platforms. However, this API does not scale to the long tail of specialized formats. In particular, custom formats, non-web-standard formats like TIFF (a large image format), and proprietary formats like docx (a document format), are not supported by the current Web Platform.
WebGL Canvas Color Management
As per the spec, Chromium's implementation of WebGL now allows specifying:
- The color space of a drawing buffer.
- The color space that content should be converted to when importing as a texture.
Before this version of Chrome, both of these defaulted to sRGB. Now they can also use "display-p3".
Deprecations, and Removals
This version of Chrome introduces the deprecations and removals listed below. Visit ChromeStatus.com for lists of previous removals.
Block Third-Party Contexts Navigating to Filesystem URLs
iframes can no longer navigate to filesystem URLs. Top frame support for navigating to filesystem URLs was dropped in Chrome 68.
Remove Non-Standard Client Hint Mode
Four client hints (dpr, width, viewport-width, and device-memory) have a default allowlist of self but behave as though they have a default allowlist of * on Android, contrary to the spec. This is now fixed, increasing privacy on Android by requiring explicit delegation of these hints.
Remove U2F API (Cryptotoken)
Chrome's legacy U2F API for interacting with security keys is no longer supported. U2F security keys themselves are not deprecated and will continue to work.
Affected sites should migrate to the Web Authentication API. Credentials that were originally registered via the U2F API can be challenged via web authentication. USB security keys that are supported by the U2F API are also supported by the Web Authentication API.
U2F is Chrome's original security key API. It allows sites to register public key credentials on USB security keys and challenge them for building phishing-resistant two-factor authentication systems. U2F never became an open web standard and was subsumed by the Web Authentication API (launched in Chrome 67). Chrome never directly supported the FIDO U2F JavaScript API, but rather shipped a component extension called cryptotoken, which exposes an equivalent chrome.runtime.sendMessage() method. U2F and Cryptotoken are firmly in maintenance mode and have encouraged sites to migrate to the Web Authentication API for the last two years.