Chrome 92: Web Apps as File Handlers, New JavaScript Features, and More
2021-06-04 04:50:00 Author: www.blogger.com(查看原文) 阅读量:128 收藏

tag:blogger.com,1999:blog-2471378914199150966.post-83379017192117501652021-06-03T12:50:00.001-07:002021-06-03T12:51:34.724-07:00Chrome 92: Web Apps as File Handlers, New JavaScript Features, and More<p>Unless otherwise noted, changes described below apply to the newest Chrome beta channel release for Android, Chrome OS, Linux, macOS, and Windows. Learn more about the features listed here through the provided links or from the list on <a href="https://www.chromestatus.com/features#milestone%3D76">ChromeStatus.com</a>. Chrome 92 is beta as of June 3, 2021</p> <h2>File Handling API</h2><p>Now that web apps are capable of reading and writing files, the next logical step is to let developers declare web apps as file handlers for files they create and process. The File Handling API allows you to do exactly this. For example, after a text editor PWA has registered itself as a file handler, you can right-click a .txt file in your operating system's file manager and instruct this PWA to (always or just once) open .txt files. This means PWAs are just a (double) click away from the file manager. </p><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-IScCsy5rb6E/YLkyJ2FAubI/AAAAAAAABkk/y73Zm4CeLbggt5hkWBR1zFD59QQamDbqACLcBGAsYHQ/s309/excontext.png" style="margin-left: 1em; margin-right: 1em;"><img alt="The Excalidraw context menu." border="0" data-original-height="159" data-original-width="309" src="https://1.bp.blogspot.com/-IScCsy5rb6E/YLkyJ2FAubI/AAAAAAAABkk/y73Zm4CeLbggt5hkWBR1zFD59QQamDbqACLcBGAsYHQ/s16000/excontext.png" /></a></div><br /><p><br /></p> <p>This improves the user experience for PWA use cases, making them more like OS apps than they are already. For example:</p> <ul><li>Office applications like text editors, spreadsheet apps, and slideshow creators.</li><li>Graphics editors and drawing tools.</li><li>Video game level editor tools.</li></ul> <p>File Handling is starting an origin trial in 92 that is expected to run until around the end of August, 2021. For more information on this feature, see <a href="https://web.dev/file-handling/">Let web applications be file handlers</a>. For information about other origin trials in this release, see <a href="#Origin-Trials">Origin Trials</a>, below.</p> <h2>Origin Trials</h2><p>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 the ones described below, visit the <a href="https://developers.chrome.com/origintrials/#/trials/active">Chrome Origin Trials dashboard</a>. To learn more about origin trials in Chrome, visit the <a href="https://web.dev/origin-trials/">Origin Trials Guide for Web Developers</a>. Microsoft Edge runs its own origin trials separate from Chrome. To learn more, see the <a href="https://developer.microsoft.com/en-us/microsoft-edge/origin-trials/">Microsoft Edge Origin Trials Developer Console</a>. </p> <h3>New Origin Trials</h3> <h4>Shared Element Transitions</h4><p><a href="https://www.chromestatus.com/feature/5193009714954240">Shared Element Transitions</a> allows a simple set of transitions in both single-page applications (SPAs) and multi-page applications (MPAs). This enhances the visual polish of pages with minimal effort by letting developers select from a set of user-agent provided transition effects. Without this, single-page app transitions are difficult since they require a careful coordination of animations and DOM manipulations to achieve the desired effect. Multi-page app transitions are, for the most part, not possible since each page can only control the contents of its own view. This origin trial is only for SPA use cases.</p> <h2>Other features in this release</h2> <h3>Change in Allowed App Shortcuts</h3><p>Most Android launchers now allow only three app shortcuts instead of the previously allowed four. A shortcut to the site settings was added to the application icon in the Android launcher, taking one of the available shortcut slots for the app. For more information, see <a href="https://web.dev/app-shortcuts/">Get things done quickly with app shortcuts</a>.</p> <h3>CSS</h3> <h4>size-adjust Descriptor for @font-face</h4><p><a href="https://www.chromestatus.com/feature/5662073285509120">Adds the size-adjust descriptor for <code>@font-face</code></a> allowing scaling of glyph sizes for a particular font face without affecting the CSS <code>font-size</code> and derived metrics such as em. CSS <code>font-size</code> can be seen as a scale factor for a box that the font draws in. Glyph sizes within that box vary between fonts, and size-adjust enables harmonising them across different fonts. That's why it reduces cumulative layout shift by matching up the fallback font and primary web font using this descriptor.</p> <h3>Imperative Slot Distribution Behavior</h3><p><a href="https://www.chromestatus.com/feature/4979822998585344">Imperative slotting</a> allows node-to-slot assignments without needing the slot attribute in markup. This enables dynamic slotting behavior based on input conditions and types. The feature originally shipped in <a href="https://chromestatus.com/feature/5711021289242624">Chrome 86</a>; in this release some adjustments to the API have been made to ensure interoperability with other browsers.</p> <h3>JavaScript</h3><p>This version of Chrome incorporates version 9.2 of the V8 JavaScript engine. It specifically includes the changes listed below. You can find a complete <a href="https://v8.dev/blog">list of recent features</a> in the V8 release notes.</p> <h4>Add dayPeriod option for Intl.DateTimeFormat</h4><p>A <a href="https://www.chromestatus.com/feature/6520669959356416">dayPeriod option</a> (part of ECMA402 2021) has been added to the <code>Intl.DateTimeFormat()</code> method so the caller can format times such as "7 in the morning", "11 in the morning", "12 noon", "1 in the afternoon", "6 in the evening", "10 at night" (or in Chinese, "清晨7時", "上午11時", "中午12時", "下午1時" ,"下午6時" ,"晚上10時").</p> <p>This enhances <code>Intl.DateTimeFormat()</code> to match what is already possible in C++ and Java by calling ICU and ICU4J. Without this feature, developers need to either format the quarter in the server or ship a set of day period patterns and hour to day period mappings from the server to client to perform such tasks.</p> <h4>Relative Indexing Method for Array, String, and TypedArrays</h4><p><a href="https://www.chromestatus.com/feature/6123640410079232">Adds a new method named <code>at()</code></a>, to <code>Array.prototype</code>, <code>String.prototype</code>, and the <code>TypedArray</code> prototypes, that permit relative indexing with negative indices. For example:<br /><br /><code>let arr = [1,2,3,4];<br />arr.at(-1); // Returns 4</code></p> <h4>Intl BestFitMatcher by Using ICU LocaleMatcher</h4><p>The ICU LocaleMatcher <a href="https://www.chromestatus.com/feature/5407573287108608">now implements the BestFitMatcher</a> abstract operation to better match locale data. </p> <h4>SharedArrayBuffers on Desktop Platforms Restricted to Cross-Origin Isolated Environments</h4><p><code>SharedArrayBuffers</code> on desktop platforms are now restricted to cross-origin isolated environments, matching the behavior recently shipped on Android and Firefox. A Cross-origin isolated page is considered a secure environment because it blocks loading cross-origin resources that are not opt-in and communicating with cross-origin windows. Only pages that opt-in to cross-origin isolation will be able to use <code>SharedArrayBuffers</code>. Learn more about the upcoming options at <a href="https://developer.chrome.com/blog/enabling-shared-array-buffer/"><code>SharedArrayBuffer</code> updates in Android Chrome 88 and Desktop Chrome 92</a>.</p> <h3>Media Session API: Video conferencing actions</h3><p>Adds actions to the Media Session API, specifically <code>"togglemicrophone"</code>, <code>"togglecamera"</code>, and <code>"hangup"</code>. This enables developers of video conferencing websites to handle these actions from the browser interface. For example, if the user puts their video call into a picture-in-picture window, the browser could display buttons for mute/unmute, turn-on/turn-off camera, and hanging up. When the user clicks these, the website handles them through the Media Session API. For more information, see the section from <a href="https://web.dev/media-session/#video-conferencing-actions">our recent article</a>, or try <a href="https://googlechrome.github.io/samples/media-session/video-conferencing.html">our demo</a>.</p> <h3>Tainted Origin Flag applied to Resource Timing</h3><p>Chrome now <a href="https://www.chromestatus.com/feature/5665918254317568">accounts for the tainted origin flag</a> when computing whether a fetched resource passes the timing allow origin check. The timing allow origin check is used in resource timing to determine whether the page can receive detailed timing information about a resource used in the page. The tainted origin flag impacts this check in cases where there are multiple redirects that cross origins. In those cases, the header should be '*'. In other words, it can no longer be a specific origin.</p> <p>If a resource performs two cross-origin crosses (via redirects), then the developer needs to use <code>Timing-Allow-Origin: *</code> for the checks to pass. For example if a page on origin A fetches a resource on origin B, which redirects to a resource on origin C, then the tainted origin flag is set and the final resource needs to have <code>Timing-Allow-Origin: *</code> in order to receive detailed timing information."</p> <h3>Web Bluetooth Manufacturer Data Filter</h3><p>The Web Bluetooth API can now filter based on manufacturer data such as vendor ID and product ID. Developers have been able to prompt users through a browser picker to select a nearby Bluetooth device that matches their advertised name and services. However it hasn't been possible to filter nearby Bluetooth devices based on advertised manufacturer specific data. Manufacturer data is specified through new properties on options.filters, which is passed to <code>Bluetooth.requestDevice()</code>. For more information, see <a href="https://web.dev/bluetooth/#manufacturer-data-filter">Communicating with Bluetooth devices over JavaScript</a> or try <a href="https://googlechrome.github.io/samples/web-bluetooth/manufacturer-data-filter.html">our demo</a>.</p> <h2>Deprecations and Removals</h2><p>This version of Chrome introduces the deprecations and removals listed below. Visit ChromeStatus.com for lists of <a href="https://www.chromestatus.com/features#browsers.chrome.status%3A%22Deprecated%22">current deprecations</a> and <a href="https://www.chromestatus.com/features#browsers.chrome.status:%22Removed%22">previous removals</a>.</p> <h3>Payment Handlers for Standardized Payment Method Identifiers</h3><p>This feature, which enabled web-based payment handlers to receive <code>paymentrequest</code> events with non-URL, but standardized payment method identifiers, such as <code>"basic-card"</code> or <code>"tokenized-card"</code>, <a href="https://www.chromestatus.com/feature/5407573287108608">has been removed</a>.</p>Chromium Bloghttps://www.blogger.com/profile/06394244468194711527[email protected]

文章来源: http://www.blogger.com/feeds/2471378914199150966/posts/default/8337901719211750165
如有侵权请联系:admin#unsafe.sh