Chrome 78 Beta: a new Houdini API, native file system access and more
venerdì 20 settembre 2019
Unless otherwise noted, changes described below apply to the newest Chrome Beta channel release for Android, Chrome OS, Linux, macOS, and Windows. Find more information about the features listed here through the provided links or from the list on ChromeStatus.com. Chrome 78 is beta as of September 19, 2019.
Take the image below, for example.
What you're seeing is a transition created with a CSS custom property. In addition to being impossible without the new API, this transition is also type safe. For details and access to the code used to generate this image, see Smarter custom properties with Houdini's new API.
To learn more, see sample code, and a text editor demonstration app, see The Native File System API: Simplifying access to local files for details.
See the Origin Trials section for information on signing up and for a list of other origin trials in this release.
The SMS Receiver API allows websites to access SMS messages that are delivered to the user's phone specifically addressed to the origin (via a special formatting convention).
CSS Properties and Values
CSS variables are getting more power with CSS Properties and Values API Level 1. With it, you can register your variables as full custom properties, ensuring they're always a specific type, and letting you set a default value, or even, animate them.Take the image below, for example.
What you're seeing is a transition created with a CSS custom property. In addition to being impossible without the new API, this transition is also type safe. For details and access to the code used to generate this image, see Smarter custom properties with Houdini's new API.
Native File System
The new Native File System API, now in an origin trial, enables developers to build powerful web apps that interact with files on the user's local device such as IDEs, photo and video editors, text editors, and more. After a user grants access, this API allows web apps to read or save changes directly to files and folders on the user's device. It does all this by invoking the platform's own open and save dialog boxes. The image below shows a web page invoked using the open dialog box on Mac.To learn more, see sample code, and a text editor demonstration app, see The Native File System API: Simplifying access to local files for details.
See the Origin Trials section for information on signing up and for a list of other origin trials in this release.
Origin Trials
This version of Chrome introduces 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 Chrome, including those described here, visit the Origin Trials dashboard. To learn more about origin trials themselves, visit the Origin Trials Guide for Web Developers.Signed Exchange Subresource Prefetching and Loading by Extending the HTTP Link Header.
Signed Exchanges allow a distributor to provide content signed by a publisher and displayed in such a way that user agents show the publisher's URL, and scripts access the publisher's local storage. The URLs of subresources are fixed in the signed top-level HTML file, which prevents their loads from taking advantage of any signed versions that might be prefetched from the distributor's origin. To allow the subresources to be prefetched from the same distributor as the top-level page,the publisher needs to change the subresource URLs in the HTML to point to each distributors’ URL and needs to sign for each distributor. The intent of this is to allow publishers to create a single signed top-level HTML file that allows its subresources to be prefetched from a variety of distributors.SMS Receiver API
Websites use SMS messages as a way to verify phone numbers by sending a one-time-password for manual entry into a form (or for copy and paste). Native platforms offer an API that gives programmatic access to such messages that allows users to skip manual interaction with the form.The SMS Receiver API allows websites to access SMS messages that are delivered to the user's phone specifically addressed to the origin (via a special formatting convention).
Other Features in this Release
Apply Opacity for the Default Style of INPUT/TEXTAREA placeholder
Changes the default style for ::placeholder from#757575
to rgba(0, 0, 0, 0.54)
.Extend Byte-for-Byte Update Check to all Service Worker importScripts() Resources
Byte-for-byte checks are now available for service worker scripts imported byimportScripts()
. Currently, service workers update only when the service worker main script has changed. In addition to not conforming to the latest spec, this forces developers to build workarounds such as adding hashes to the imported script's urls. Faster Web Sockets
Chrome 78 improves the download speed ofArrayBuffer
objects when used with WebSocket
objects on desktop. We have seen the following improvements in our own testing. Results depend on network speed and hardware so your results may be vary.- Linux: 7.5 times faster
- Windows: 4.1 times faster
- Mac: 7.8 times faster
More restrictive hasEnrolledInstrument() for Autofill Instruments
Improves the authorization of transactions by requiring unexpired cards and a billing address. This improves the quality of autofill data and increases the chances thatPaymentRequest.hasEnrolledInstrument()
returns true. This improves the user experience on transactions that use autofill data.PaymentResponse.prototype.retry()
In cases where there is something wrong with the payment response's data (for example, the shipping address is a PO box), theretry()
method of a PaymentResponse
instance now allows you to ask a user to retry a payment.Percentage Opacity
Adds support for percentage values to the opacity properties, specifically,opacity
, stop-opacity
, fill-opacity
, stroke-opacity
, and shape-image-threshold
. For example, opacity: 50%
is equivalent to opacity: 0.5
. This brings consistency and spec compliance. The rgba()
function already accepts percentage alpha value, for example rgba(0, 255, 0, 50%)
.Redact Address in PaymentRequest.onshippingaddresschange Event
Removes fine-grained information from the shipping address before exposing it to a merchant website in theShippingAddressChange
event. PaymentRequest.onshippingaddresschange
is used to communicate the shipping address a user has selected to the merchant so they can make adjustments to the payment amounts such as shipping cost and tax. At this point, the user has not fully committed to the transaction, so the principle should be to return as little information as possible to the merchant. The redaction removes recipient
, organization
, addressLine
and phoneNumber
from the shipping address because these are not typically needed for shipping cost and tax computation.Seeking
Adds a media session action handler for theseekto
action. An action handler is an event tied specifically to a common media function such as pause or play. The seekto
action handler is called when the site should move the playback time to a specific time.User Timing L3
Extends the existing User Timing API to enable two new use cases:- Developers can pass custom timestamps to
performance.measure()
andperformance.mark()
, so as to conduct measurement across arbitrary timestamps. - Developers can report arbitrary metadata with
performance.mark()
andperformance.measure()
, which provides rich data to analytics via a standardized API.