What's new for the web platform | Keynote
Google's 2021 web platform keynote covers privacy, app integration, WebAssembly, graphics and tools for building faster web experiences.
字幕來源:創作者上傳至 YouTube 的字幕。Vidleaf 加入 AI 標點,保留原字詞與時間戳。下方可查看原始字幕。
AI 生成摘要
This 2021 Chrome keynote presents the web platform through three themes: privacy, more capable applications and developer productivity. The speakers discuss Privacy Sandbox proposals, browser integration with files and devices, graphics, WebAssembly and performance improvements. They also connect developer tools and Core Web Vitals with the work of making applications faster and more consistent across browsers. The talk is a record of features, experiments and plans announced at that event. Its examples help explain the direction of the platform at the time; references to upcoming releases and trials belong to that historical setting.
重點
- [2:32] The keynote frames browser privacy work around isolation and purpose-built alternatives to broad tracking.
- [18:26] WebAssembly brings existing non-JavaScript code to browser applications.
- [26:38] Cross-browser compatibility is presented as a continuing priority for web developers.
根據字幕生成。請透過連結對照原影片核對。 概覽與重點由 Vidleaf 於 2026-10-21 核對。
完整概覽
Chrome leaders Ben and Dion describe how the web has evolved from simple connected documents into a high-performance, general-purpose computing platform used by billions, with the pandemic accelerating online interaction and the pace of change. The session organizes the year's developments around three themes: privacy by default, powerful and seamless web apps, and developer productivity. On privacy, it explains the Privacy Sandbox model, the change making cookies visible only to the site that set them (now enforced in Chrome, Edge, and very soon Firefox), and privacy-preserving API alternatives such as Attribution Reporting, which shares no user-identifying data and uses differential privacy, as Google prepares to phase out third-party cookies and address other covert tracking. For web apps, it covers re-engagement features like app shortcuts, the Badging API, and an upcoming Declarative Link Capturing origin trial, improved install UI, the Multi-Screen Window Placement API, the File System Access API, and a hoped-for experimental File Handling API, plus device APIs including Web HID (with the Joy-Con as an example), the Gamepad API, and Web Serial, which Piper Make uses to program a Raspberry Pi Pico without installing software or drivers. Graphics and performance coverage includes the beta of Maps tilt and rotation and WebGLOverlayView (demoed with three.js over the Yucatán Peninsula), the experimental WebGPU, and a V8 SIMD origin trial that gave Google Meet a 200% gain on its in-browser media processing pipeline. A second part surveys further gains: a background blur feature powered by TensorFlow in the browser, SIMD planned for all Chrome users, WebAssembly porting work such as Replicache compiling Rust to WebAssembly, WebAssembly threads arriving on Chrome for Android in Chrome 88, improved WebAssembly debugging in Chrome DevTools, the V8 Sparkplug compiler, intensive timer throttling shipped to some users, content-visibility support, BFCache on Android in Chrome 87 with plans to expand to desktop, a pre-rendering API for same-site pre-loading later this year, scroll-to-text extensions, upcoming document transition APIs, cross-device one-time passwords, Core Web Vitals and Lighthouse tooling, the Compat2021 cross-browser effort focused on CSS pain points, and DevTools updates and extensions.
附時間戳的章節摘要
Chrome Leaders on Web Evolution and I/O Themes
- [0:05] Ben and Dion are leaders on the Chrome team who have worked together on the web platform for many years.
- [0:13] Websites have evolved from simple connected documents to rich interactive web apps, and the web is now a high performance, general purpose computing platform used by billions globally.
- [0:29] The pandemic pushed more daily interactions online, accelerating the web's growth and triggering a rush to improve web experiences as usage spikes.
- [0:47] Many computing platforms have risen and fallen, and the old adage 'evolve or die' plays a major role in any platform's ongoing relevance.
- [1:02] The pace of the web's evolution is accelerating because it has to keep pace with tech and society generally.
- [1:11] At Google I/O this year, sessions will cover the latest web developments, and this session summarizes key themes to keep in mind this year.
- [1:29] The session covers three themes: privacy by default for all users, powerful fast seamless web apps, and helping developers be productive and successful.
Privacy Sandbox and Cookie Changes
- [1:57] Modern browsers isolate each website by default using a sandbox model.
- [2:15] Chrome first isolated each website into its own process, and more recently isolates each cross-site iframe into its own process.
- [2:32] Google is applying the sandbox approach to user data and tracking through a privacy sandbox intended to keep information safe within the browser.
- [2:50] The Privacy Sandbox was announced two years ago as an open initiative with the community, with care to transition the web ecosystem thoughtfully.
- [3:09] The first step was changing cookies in Chrome so they are visible only to the same website that set them, requiring developers to opt in to third-party cookies.
- [3:35] The previous wide default cookie visibility created a security problem by exposing users to cross-site request forgery attacks.
- [4:01] This privacy-preserving default is now enforced in Chrome, Edge, and very soon Firefox.
- [4:07] Google is collaborating on a family of APIs as privacy-preserving alternatives for use cases like federated login, personalized ads, and conversion tracking.
- [5:17] The Attribution Reporting API shares no user-identifying data between sites; the browser tracks the ad conversion and sends an encrypted report with time delays and noise, a technique known as differential privacy.
- [6:06] Attribution Reporting is available as a Chrome origin trial experiment today along with several other APIs, with more to ship during the year.
- [6:21] Google is preparing to phase out third-party cookies and implement protection against other forms of covert tracking.
Web App OS Integration Advances
- [6:57] The web has become a powerful application platform with fast, seamless experiences in modern browsers.
- [7:11] Chromebooks show web access can be affordable, safe, and simple without OS maintenance expertise.
- [7:23] Google's mission is to give the web the capabilities needed for state-of-the-art computing experiences.
- [7:40] Google has worked on making it easy for users to seamlessly re-engage with web apps.
- [8:03] The new app shortcuts feature lets web apps expose quick actions on Android, Chrome OS, Windows, and macOS.
- [8:14] The Badging API lets web apps give a subtle re-engagement prompt by decorating the app icon.
- [8:24] Chrome will soon ship an origin trial of Declarative Link Capturing, which auto-launches installed web apps on appropriate links and can prevent multiple instances.
- [8:45] Chrome's web app installation UI improved: desktop shows an omnibox icon with in-product help, and Android has a richer dialog populated from the manifest.
- [9:15] The Multi-Screen Window Placement API lets web apps discover connected displays and control window placement, useful for presentation and video conferencing apps.
- [9:36] The File System Access API lets web apps read and write the local file system, as used by Gravit Designer and PhotoBee.
- [9:54] A new File Handling API would register web apps as file type handlers so users can open files directly from OS file browsers, with an experimental release hoped for later this year.
New Web APIs for Device Connectivity
- [10:20] The web has long been able to communicate with Bluetooth MIDI devices.
- [10:25] Several new APIs now support a broader collection of these devices.
- [10:35] Web HID is a new API for devices that communicate using the HID protocol.
- [10:40] Nintendo's Joy-Con controller is an example of a device that supports the HID protocol.
- [10:48] The industry standard Gamepad API is now supported by the web, enabling uncompromising gameplay with apps like Stadia in the browser.
- [11:01] The Web Serial API adds serial port support to the web.
- [11:13] Piper Make is a block-based editor for programming a Raspberry Pi Pico by plugging in the device and opening a browser, with no software install or driver setup needed thanks to Web Serial.
- [11:31] These and other new web capabilities enable deeply integrated, seamless experiences through the browser.
Maps WebGL 3D Features Beta
- [11:49] Maps adopted WebGL years ago to enable hardware-accelerated graphics and a more powerful UI.
- [11:58] Last year the Maps team made WebGL-accelerated map capabilities available in web apps via the Maps JavaScript API.
- [12:34] At the developer keynote, the beta release of two new features was announced: tilt and rotation, and WebGLOverlayView.
- [12:46] These features let developers manipulate the map in three dimensions for the first time using the same WebGL context used to render the base map.
- [13:06] The demo uses three.js to render a 3D object on a map centered on the Yucatán Peninsula of Mexico, with a map ID for the vector map and custom styling.
- [13:29] WebGLOverlayView is implemented by extending google.maps.WebglOverlayView and exposes hooks into the base map's WebGL rendering context life cycle.
- [13:51] The demo focuses on three hooks: onAdd() when the overlay instance is created, onContextRestored() once the rendering context is available, and onDraw() where rendering happens.
- [15:47] A transformer object with the fromLatLngAltitude function creates the projection matrix, saving developers the matrix math.
- [16:30] Tilt and rotation and WebGLOverlayView are the latest delivery on the team's commitment, with more planned.
Web Graphics and WebAssembly Performance
- [16:50] WebGL brought a new level of graphics performance to the web when it became available several years ago.
- [16:56] They are working closely with the graphics and web communities on WebGPU, a next-generation graphics API designed from the ground up to unlock new graphics performance on the web.
- [17:10] WebGPU takes inspiration from low-level APIs like Vulcan, Metal, and Direct 3D 12 and is still very experimental but holds exciting promise.
- [17:22] Web Assembly provides a standard for compiling code to a fast and efficient format executable in the browser by modern JavaScript engines like V8.
- [17:34] They recently gave Web Assembly a major performance boost by implementing support for SIMD processor instructions in V8, enabling certain classes of apps to run much faster.
- [17:46] Google Meet provides a powerful example of SIMD in action.
SIMD boosts Google Meet performance
- [17:55] There is a constant tension between processing video to enhance it and maintaining a smooth, low-latency stream.
- [18:03] Using V8's experimental origin trial of SIMD, the Meet team achieved a 200% performance gain on their in-browser media processing pipeline.
- [18:13] This gain gave them the budget to enable a background blur feature, powered by TensorFlow in the browser, for most of their users.
- [18:22] SIMD is planned to ship to all Chrome users in the coming months.
WebAssembly Porting and V8 Updates
- [18:26] WebAssembly is often used to bring non-JavaScript codebases to the web for new use cases.
- [18:34] Replicache developers compiled their Rust code to WebAssembly so web developers could incorporate it into web apps.
- [18:48] V8 added threading support to WebAssembly in 2019 to ease code porting, but it was only enabled for desktop operating systems.
- [18:57] Chrome for Android gained WebAssembly threads as of Chrome 88 in January.
- [19:06] V8 enhanced WebAssembly debugging with breakpoints and variable inspection in Chrome DevTools.
- [19:25] The V8 team has also been working on squeezing more JavaScript performance out of its engine.
V8 Compiler and Chrome Performance Features
- [19:31] V8 not only interprets JavaScript but also compiles code on the fly for more efficient execution.
- [19:38] The team implemented a new compiler called Sparkplug.
- [19:49] Earlier this year Chrome shipped intensive timer throttling to some users.
- [19:57] Intensive timer throttling detects when a tab has been in the background for more than five minutes and, as long as the tab isn't playing audio or video, slows down how frequently timer-based JavaScript executes on that tab.
- [20:10] Chrome shipped support for a new CSS property called content-visibility.
- [20:17] Setting content-visibility to auto on an element lets the browser skip rendering that element tree's contents if it isn't currently visible on the user's display.
- [20:29] This can lead to a dramatic speed boost for content-heavy sites.
Chrome Instant Navigation and Pre-rendering
- [20:51] Chrome 87, released in November last year, added back/forward cache (BFCache) to Chrome on Android.
- [21:00] BFCache keeps some web pages loaded in memory after navigating away, so back or forward displays the page instantly.
- [21:11] One in five navigations on mobile move backwards or forwards through the history stack.
- [21:21] Chrome's BFCache is currently available on Android with some limitations, and there are plans to expand it to Chrome desktop soon.
- [21:38] Pre-rendering loads a webpage's resources and renders the DOM before the user clicks a link, but it is hard to get right due to side effects and possible user information leaks across sites.
- [22:19] A new pre-rendering API would let developers experiment with same-site pre-loading later this year.
- [22:36] Scroll to text, added in Chrome 80 in February of last year, lets browsers position the viewport to a specific text element and highlight it.
- [22:53] A version of the scroll-to-text API that scrolls to images is coming soon, and other element types are being explored.
- [22:59] New document transition APIs coming to Chrome soon as experiments support graphical transitions between elements.
Cross-device one-time passwords on the web
- [23:17] Google is working to make security more seamless on the web.
- [23:22] Cross-device one-time passwords for the web is a feature the speaker is particularly excited about.
- [23:26] One-time passwords are numeric codes that some sites send you to log in.
- [23:31] The feature lets you receive a one-time password on your Android phone and have it automatically transferred to Chrome on another device like a laptop.
- [23:45] The pace of web evolution is accelerating.
Core Web Vitals and Developer Tools
- [23:54] Google is working to make the web easier for developers and partnering with the broader ecosystem to address the platform's top pain points.
- [24:03] web.dev offers detailed tutorials, latest news, and access to the Lighthouse website auditing tool.
- [24:18] Lighthouse provides a comprehensive report on improving a website across categories such as performance, accessibility, and SEO.
- [24:35] Three Lighthouse performance metrics, called Core Web Vitals, are particularly impactful on user experience.
- [24:44] Core Web Vitals collectively measure how fast a site displays key content, how responsive it is for the first interaction, and how much its layout shifts.
- [25:03] Italian publisher GEDI saw an 8% improvement in bounce rate on mobile article pages by using a branded placeholder to reserve ad space and deferring some JavaScript until after the page was visible.
- [25:41] Shopify and Wix implemented performance dashboards in their admin consoles, and the WordPress community shipped lazy loading for images and iframes.
- [25:56] Google updated its Site Kit plugin for WordPress with Core Web Vitals measurement support and specific improvement recommendations.
- [26:07] Google Search announced that Core Web Vitals will soon be part of how pages are ranked in search results.
Cross-Browser Compatibility and CSS Renaissance
- [26:38] Developers consistently emphasize the importance of cross-browser compatibility.
- [26:42] This year they announced participation in a cross-industry effort called Compat2021.
- [26:49] Compat2021 aims to fix the top five browser compatibility pain points as voted on by web developers, which all happen to be CSS related.
- [27:00] CSS is seeing an exciting renaissance, with CSS Flexbox and Grid embraced by developers as major improvements for page layouts.
- [27:13] Learnings from years of CSS frameworks like Sass, such as nesting, are being baked into the platform.
- [27:22] Container queries, the most requested CSS feature, will enable more modular and reusable style sheets by scoping rules naturally to their local context versus acting globally.
Chrome DevTools Updates and Extensions
- [27:37] Chrome's built-in developer tools are among its most popular features and serve as a powerful web development copilot.
- [27:48] Over the past year, DevTools gained improvements including a new color picker, improved PWA warnings and linting, a Core Web Vitals overlay, dedicated CSS Flexbox debugging, dropped frame visualization, and CSS and JavaScript support.
- [28:09] DevTools is also a platform that supports extensions.
- [28:14] The Angular DevTools Chrome extension provides debugging and performance profiling support specific to Angular apps.
- [28:25] Viewers are directed to the Chrome DevTools session for a deep dive into these new features.
- [28:33] The web is evolving in fundamental ways, becoming private by default with new APIs that protect user privacy.
Web platform gains and ecosystem support
- [28:43] The platform continues to gain powerful new capabilities that broaden what is possible and provide for better user experiences.
- [28:51] The team is committed to partnering with developers in the ecosystem as the web evolves, to make sure they have the tools and guidance for success.
- [29:01] Viewers can dive deeper into many of these web platform improvements by checking out other sessions at this year's I/O.
- [29:11] The speaker thanks viewers and looks forward to seeing what they build with the evolved capabilities of the modern web.
- [29:17] Viewers watching during I/O Week are invited to come find the team in Adventure.
[0:05] -I’m Ben. -And I’m Dion. We’re leaders on the Chrome team. [Dion] The two of us have been working together on the web platform for many years. It’s been fun to watch as websites have evolved from simple connected documents to today's rich interactive web apps. The web has become a high performance, general purpose computing platform used by billions of people all across the globe. [Dion] The web’s growth has accelerated in the last year as the pandemic has pushed more of our daily interactions online, triggering a rush to improve web experiences as usage spikes.
[0:40] And for us, this reinforces the importance of the web and the need for all of us to work together to make it better. Now we’ve seen many computing platforms rise and fall over the past decades. One thing is really clear: the old adage evolve or die plays a major role in the ongoing relevance of any platform. Now, the web has evolved a great deal over the years. And looking forward, I think the pace of evolution is accelerating. because it kind of has to to keep pace with tech and society generally. So at Google I/O this year, we have a number of sessions that will bring you up to speed on some of the latest developments in the web.
[1:19] In this session, we’ll give you a quick summary of what we think are the key themes that you should keep in mind this year. And we’ll point you to where you can learn more and go deeper. We're going to start with privacy, explaining how the web is evolving to enable a private browsing experience for all users by default. Next we’ll cover how the web is enabling a new generation of powerful, fast, and seamless web apps and a fantastic user experience. And finally, we’ll summarize the work we’re doing to help developers be productive and successful with the web.
[1:52] So let’s get started with privacy, and we'll do that by talking about sandboxes. Modern browsers are built around the metaphor of a sandbox. Each website you visit is isolated by default from the rest of your system, including from websites and other open tabs, just as though we’re surrounded by virtual walls like those of a sandbox in a garden. Now Chrome’s innovated with the browser sandbox model from its earliest days, first by isolating each website into its own process.
[2:23] And more recently, expanding on that to isolate each cross-site iframe on a webpage into its own process. We’re taking this same approach with user data and tracking, building a sort of privacy sandbox that seeks to keep all of your information safe and secure within your browser, resulting in a web where your identity and activity are private by default. We announced the Privacy Sandbox effort two years ago, as an open initiative, a collaboration with the community to bring this vision to life while also being careful to help transition the web ecosystem to a new model in a thoughtful, deliberate way.
[3:07] We’d like to give an update on our progress. Our first step, announced at Google I/O two years ago, was changing the behavior of cookies in Chrome, moving them from being visible across websites by default to being visible only to the same website that set them. Before this change, it wasn’t really clear whether a cookie was intended for first-party or third-party use and browsers needed to observe how cookies were used in the wild to infer their purpose. This also created a security problem because this wide default visibility of cookies exposed users to cross-site request forgery attack based on third parties observing the information in these cookies.
[3:48] Now, developers are required to opt in to use cookies across sites as so-called third-party cookies. And in turn, browsers could then disable such cookies in a very straightforward manner. This privacy-preserving default behavior is now enforced in Chrome, Edge, and, very soon, Firefox. Next we’ve been collaborating with the ecosystem on a new family of APIs that provide privacy-preserving alternatives to use cases that today rely on third-party cookies, such as federated login, personalized ads, and conversion tracking.
[4:23] To clarify how these APIs are approaching this challenge, let’s take a closer look at one of them: the Attribution Reporting API. So a key aspect of any web business is how you grow your user audience, and that often involves advertising to increase traffic. On the other side of those ad dollars, content publishers on the web often rely on revenue from advertisements to make their business model work. Finding out how many users actually clicked on the ad and whether those users subsequently did something like sign up for a newsletter or complete a purchase, is an important part of this model.
[5:01] Traditionally, this measurement is performed by tracking the user from before and after the click across websites with a third-party cookie. So how can we do this in a way that doesn’t involve tracking that user? Well, enter Attribution Reporting. Using this proposed API, no user-identifying data is shared between the sites. Instead, it’s the browser that keeps track of the ad conversion. Later, the browser sends an encrypted report to the advertiser for each of these conversion events.
[5:34] But it adds time delays and noise to these reports to further stifle attempts to identify users. This technique is broadly known as differential privacy. This approach enables both parties to still be able to measure the effectiveness of their ad campaigns and to understand what behavior the ads are able to drive and to do so without tracking the user across sites. Now Attribution Reporting is one of many new API proposals in the Privacy Sandbox project.
[6:06] It’s available for use as a Chrome origin trial’s experiment today, along with several other APIs, And we’ll ship more throughout the course of the year. As we work with all of you across the ecosystem to bring these new APIs to the web platform, we’re also moving forward with preparations to phase out third-party cookies and implementing protection against other forms of covert tracking. And we’ve got more details on what to do with your own cookies today in the technical sessions.
[6:36] So the Privacy Sandbox project represents a substantial evolution of the web platform, enabling privacy by default while also preserving critical web use cases. A change this large and fundamental to the web will take time, but we’re committed to this work and the benefits it will bring to web users globally. The web has evolved into a powerful application platform, enabling anyone with a modern browser to get access to category-leading experiences that load fast and run seamlessly.
[7:11] And devices like Chromebooks show how access to the web could be made affordable, safe, and simple with no need to be an expert at maintaining the underlying operating system. For years, we’ve been on a mission to ensure the web has all of the capabilities needed to bring state-of-the-art computing experiences to the platform. And since we last spoke to you at I/O, the web’s gained a significant array of new capabilities. We'd like to highlight a few of these for you. One area we’ve been working on has been making it easy for users to seamlessly re-engage with web apps.
[7:47] It has been possible for a few years to easily add web apps as icons to native launchers across both mobile and desktop, and it’s one of my favorite platform features. We want to talk about how we’ve deepened this integration between web apps and the underlying OS. With the new app shortcuts feature, web apps can expose quick actions on operating systems that support this feature, such as Android, Chrome OS, Windows, and macOS. And with the Badging API, web apps can give the user a subtle prompt that there’s an opportunity to re-engage by decorating the app’s icon.
[8:24] Soon, we'll be shipping a Chrome origin trial experiment of another new API, Declarative Link Capturing, that enables installed web apps to launch automatically when the user clicks on an appropriate link. This can also prevent multiple instances of the same app from opening so you don’t have like 10 tabs with the same web app in it. We’ve also recently improved Chrome’s web app installation UI. On desktop, we now show an omnibox icon and provide in-product help to explain this feature to users.
[8:57] And on Android, we’ve made the dialogue look richer and more familiar to users, and we’ve made it easy for developers to populate the dialogue with custom images and texts that are specified in the web app’s manifest file. So those are ways that we’re improving the web’s integration with OS launches. We're also adding other OS integrations, such as the Multi-Screen Window Placement API, which allows web apps to discover all of the connected displays and control where the window is placed on those screens.
[9:29] This is actually a pretty handy feature these days for web-based presentation and video conferencing apps. Now web apps can finally read and write to the user's local file system using the File System Access API, enabling apps like Gravit Designer and PhotoBee to provide a much more seamless user experience, persisting state to disk and working with existing files. We’re also working on a new File Handling API that would allow web applications to be registered as file type handlers, enabling users to open files directly in a web app from OS file browsers.
[10:08] We hope to ship an experimental release of this API later this year. Now let’s talk about peripheral devices; things like special-purpose keyboards, game controllers, digital pianos, headsets, and more. Now, the web’s had the ability to communicate with Bluetooth on MIDI devices for a while. But several new APIs now enable support for a broader collection of these devices. Many of these, communicate using the HID protocol. The web now has an API for this in Web HID.
[10:40] Nintendo’s Joy-Con controller is an example of a device that supports this protocol. For gamepad style controllers, the industry standard Gamepad API is now supported by the web as well, and this enables uncompromising gameplay with apps like Stadia in the browser. And you can also use a gamepad to control the Chrome dino in style. The web also now supports serial ports with the Web Serial API. This actually unlocks one of my favorite new use cases: Piper Make.
[11:13] It’s a block-based editor that allows you to program a Raspberry Pi Pico. All you do is simply plug in the device to any computer, open a browser, and off you go. No need to install software or mess with drivers, all thanks to Web Serial. Now with these and other new web capabilities, you can bring deeply integrated, seamless experiences to users everywhere right through the browser. Google Maps holds a special place in our hearts as a singularly influential web app when it first launched over 15 years ago.
[11:46] Maps continues to innovate on the web. Several years ago, they embraced WebGL, enabling hardware-accelerated graphics and delivered a much more powerful Maps UI in the process. Last year, the Maps team enabled those same WebGL-accelerated map capabilities to be used in your web app via the Maps JavaScript API. This year, the team has something new to share. Join me in welcoming Travis McPhail, the team’s engineering lead, who will tell us more about it.
[12:18] We’re constantly amazed by all the ways you’ve used your skill, your creativity, and Google’s knowledge of the real world to build an unbelievable variety of experiences that have truly re-imagined the map. And it's in that spirit today, during the developer keynote, we announced the beta release of two new features that give you unprecedented control of the base map: tilt and rotation, and WebGLOverlayView. With these features, you can manipulate the map in three dimensions for the first time while taking advantage of the power of the same WebGL context we use to render the base map.
[12:57] For the first time ever, you can build not just on top of the map, but you can build with it. Let's take a quick look at how it works. To make things easy, I’m using three.js, a popular web graphics library, to render a 3D object on the map. I've set up a basic web app that loads the map centered on a location in the Yucatán Peninsula of Mexico. And I'm using a map ID so that I can use the vector map and apply some custom styling.
[13:29] The first thing I need to do is implement WebGLOverlayView by extending google.maps.WebglOverlayView. The WebGL overlay exposes a set of hooks into the life cycle of the WebGL rendering context of the base map. For today, we'll keep things as simple as possible and focus on just three of them. The first, onAdd(), is called when the overlay instance is created. The second, onContextRestored(), is called once the rendering context is available.
[14:01] And the third, onDraw(), is what the map and anything else you specify is actually rendered. In onAdd(), I’m going to set up everything that the sscene needs that doesn’t require immediate access to the rendering context. I start by creating a new three.js scene. I also create a camera that represents the view port of the scene. In this case, a perspective camera. Next, the scene needs at least one light source so that any rendered objects are illuminated in the scene.
[14:35] For this example, ambient light is used to equally illuminate all objects in our scene. Now I’m ready to add my 3D object using the GLTFLoader. Once the object is loaded, I scale and rotate it. to have it rendered just right. Then I add it to the scene. In onContextRestored(), I configure the three.js WebGLRenderer, passing it the map’s rendering context and information about the viewport. Once the object renders, I also want to animate the camera to give my users a dynamic view of the object.
[15:13] I called moveCamera in the setAnimationLoop function of the renderer. I also increment tilt, heading, and zoom just a little bit in each frame to create a nice downward spiral motion. All right. Time to render. The three.js camera needs a projection matrix so that it knows how to render latitude and longitude coordinates in the 3D world of the map to the 2D coordinates of the screen. Now, I don’t know about you, but matrix transforms are not my idea of a good time.
[15:47] So, to save you a bunch of math, we hand you a transformer object that has the fromLatLngAltitude function which creates this matrix for you. I pass it the lat-long coordinates where I want the model to appear, and I set the return value as a camera.projectionMatrix. All that’s left is to clear the GL state, tell WebGLOverlayView I want to redraw by calling requestRedraw() on the WebGLOverlayView instance and render the scene.
[16:18] And finally, I create an instance of my class and set the map instance I want it applied to. And this is the result. Not too bad for a few minutes of coding, right? Tilt and rotation and WebGLOverlayView are just the latest way we're delivering on our commitment to you. We have a lot more planned, and we can’t wait to see all the ways you’ll come up with to reimagine the map all over again and show us what’s next. Back to you, Dion. Thanks, Travis.
[16:50] WebGL brought whole new level of graphics performance to the web when it became available several years ago. We are currently working closely with the graphics and web communities on WebGPU, the new next-generation graphics API, designed from the ground up to unlock a whole new level of graphics performance on the web. Taking inspiration from low-level APIs like Vulcan, Metal, and Direct 3D 12, WebGPU is still very experimental that holds exciting promise for the future.
[17:22] Another key performance technology is Web Assembly, which provides a standard for compiling code to a fast and efficient format that can be executed in the browser by modern JavaScript engines like V8. We recently gave Web Assembly a major performance boost by implementing support for SIMD processor instructions in V8, which enables certain classes of apps to run much faster. Google Meet provides a powerful example SIMD in action. Like any video conferencing app, Meet has to pay careful attention to their performance budget.
[17:55] And there’s a constant tension between processing the video in order to enhance it and maintaining a smooth, low-latency stream. Using V8′s experimental origin trial of SIMD, the Meet team achieved a 200% performance gain on their in-browser media processing pipeline. And this in turn, gave them the budget to enable a background blur feature for most of their users that was powered by TensorFlow in the browser. We’re planning to ship SIMD to all Chrome users in the coming months.
[18:26] Now, Web Assembly is also frequently used to bring non-JavaScript codebases to the web, unlocking them for new use cases. For example, the developers behind the offline-first sync engine, Replicache, were able to compile their Rust code to Web Assembly, enabling web developers to seamlessly incorporate it into their web app. To ease with code porting, V8 added threading support to Web Assembly back in 2019. But it was only enabled for desktop operating systems.
[18:57] We’re pleased to share today that Chrome for Android gained Web Assembly threads as of Chrome 88 in January of this year. We’ve also enhanced V8′s Web Assembly debugging experience with support for breakpoints and variable inspection right there in Chrome DevTools. We’re so excited to see what you deliver with a universal runtime that works on client or server is san bugs, and wicked fast. That's Web Assembly. The V8 team has also been hard at work at squeezing even more JavaScript performance out of its engine.
[19:31] So in addition to interpreting JavaScript, V8 also compiles code on the fly for more efficient execution. And the team has implemented a whole new compiler called Sparkplug. Of course, sometimes the best way to improve code execution performance is to not execute any code at all. In this spirit, earlier this year, we shipped a new Chrome feature to some users called intensive timer throttling that detects when a browser tab has been in the background for more than five minutes and as long as the tab isn’t playing any audio or video, Chrome slows down how frequently it executes timer-based JavaScript code on that tab.
[20:10] We've also applied this concept with CSS by shipping support for a new CSS property called content-visibility. When you set this property to auto on an element, you’re giving the browser permission to skip rendering the contents of that element tree if it isn’t currently visible on the user’s display, and this can lead to a dramatic speed boost for content-heavy sites. Now, there’s a ton of innovation happening on the web platform to enable significantly faster runtime performance of your web apps.
[20:40] In addition to the work happening to expand the power and performance of the web, the platform’s also evolving to deliver an instant and seamless experience for users. In Chrome 87, released in November last year, we added a so-called back/forward cache to Chrome on Android, or BFCache for short. BFCache keeps some web pages loaded in memory after you’ve navigated away from them. So if a user clicks back or forward, the page is displayed instantly. And it turns out, one in five navigations on mobile are doing exactly that, moving backwards or forward through the history stack.
[21:18] So this feature drives a really big impact. While today, Chrome’s BFCache implementation is available on Android, it does have some limitations. We are planning to expand it to the Chrome desktop platform soon. Another way we’re expanding instant experiences is by revisiting the notion of pre-rendering pages. Pre-rendering is the technique of loading all of a webpage’s resources and even rendering the DOM before the user clicks on a link. So it can be displayed truly instantly.
[21:48] Now this is hard to get right because pre-loading these pages can also cause side effects, if the page does something like sign out or if the page plays audio, then it can also start playing in a mysterious way. Also, it can leak some user information if it's done across sites. But when pre-rendering is done right, it provides this powerful, instant click-through experience for the user. So, we’re working on new approaches to pre-rendering that are private and safe. One of these involves a new pre-rendering API that would enable developers to experiment with this on same site pre-loading later this year.
[22:26] And transitions are another important aspect of the user experience, ensuring that users are able to shift their context as they navigate the web and get right to where they want to go. One fun, simple feature with a big impact is scroll to text, added to Chrome 80 in February of last year. By adding a new type of expression to the end of your URL, browsers can position the viewport to a specific text element and highlight it in some way. Soon we’ll be shipping a version of this API that scrolls to images, and we're exploring other element types too.
[22:59] With the new document transition APIs that are coming to Chrome soon as experiments, we’re also building in support for a number of graphical transitions between elements, enabling the user to perceive a seamless experience as they move between states of your web app. We're also working to make security more seamless on the web. One feature I’m particularly excited about is cross-device one-time passwords for the web. One-time passwords are these numeric codes that some sites can send you to log in.
[23:31] This feature enables you to receive one of these one-time passwords on your Android phone, and then have that automatically transferred to your Chrome browser running on some other device like a laptop. All of these new web capabilities are exciting. But as the pace of web evolution accelerates, so too does the complexity we face as web developers in keeping track of everything. We’re working to make the web easier for developers and partnering with the broader ecosystem to understand and address the platform's top pain points.
[24:03] To understand our latest recommendations for web development, visit web.dev. The site includes detailed tutorials on key topics, the latest news, and it also provides access to our Lighthouse website auditing tool. Now, with Lighthouse, you get a comprehensive report on how to improve your website, across a variety of categories such as performance, accessibility, and SEO. We continually update Lighthouse guidance to give you the very best insights we can.
[24:35] We found that three of Lighthouse’s performance metrics are particularly impactful on the user experience. We call these Core Web Vitals. And collectively, they measure how fast a site displays key content, how responsive the site is for the first interaction, and how much the site’s layout shifts around. Sites across the web were using Core Web Vitals as a North Star for performance and are reporting encouraging results. For example, the Italian publisher GEDI saw an 8% improvement in the bounce rate on their mobile article pages.
[25:13] They did this by implementing a branded placeholder in order to reserve space for ads in their ad slots on the page, which improved their layout stability, and then by deferring loading of some their JavaScript code until after the page was visible, they improved the perceived page loading speed. Web content and commerce platforms. are also investing in Core Web Vitals to improve the performance of all of their hosted sites. For example, Shopify and Wix implemented dashboards in their admin console that puts performance front and center for site owners.
[25:49] The WordPress community has also shipped performance-oriented additions, such as lazy loading for images and iframes. We’ve also updated Site Kit, Google’s official plugin for WordPress, with support for measuring Core Web Vitals, and it also makes specific improvement recommendations to developers. Google Search has also announced that Core Web Vitals will soon be a part of how pages are ranked in search results. We think this is particularly exciting, as it magnifies the benefit of Core Web Vitals to you, the developer.
[26:21] The investment will not only give your users a better experience, but it will help them find your site through such. We spent a good amount of time listening to developers, both in small gatherings and through scaled developer surveys. One of the common themes we consistently hear is the importance to developers of cross-browser compatibility. So this year, we recently announced our participation in a cross-industry effort called Compat2021, which aims to fix the top five browser compatibility pain points as voted on by web developers, which, shockingly, all happen to be CSS related.
[27:00] And speaking of CSS, we’re seeing an exciting renaissance in this area. We even have our own modern-day zen garden. CSS Flexbox and Grid have been embraced by developers as major improvements for creating page layouts, and learnings from years of CSS frameworks like Sass are being baked into the platform, such as nesting. And along with container queries, which is your most requested feature, I think, for CSS, you will be able to create style sheets that are more modular and reusable by enabling rules that are scoped naturally to their local context versus acting so globally.
[27:37] Now, one of Chrome’s most popular features is its suite of built-in developer tools, which give you an incredibly powerful toolkit that can function as your web development copilot. Over the past year, we’ve enhanced DevTools with a bevy of new improvements ranging from a new color picker, improved warnings and linting of PWAs, a Core Web Vitals overlay, dedicated CSS Flexbox debugging, dropped frame visualization, support for CSS and JavaScript, and much more.
[28:09] And DevTools is also a platform because it supports extensions. And one example of a new extension is the Angular DevTools Chrome extension, which provides debugging and performance profiling support that’s specific to Angular apps. So check out our Chrome DevTools session to deep dive into all of this and learn more about our new DevTools features. The web is evolving in fundamental ways so it doesn’t become extinct. It’s becoming private by default with new APIs that protect user privacy, and it also continues to gain powerful new capabilities that broaden what’s possible on the platform, providing for better user experiences.
[28:51] Lastly, we’re committed to partnering with you in the ecosystem as the web evolves to make sure that you’ve got all of the tools and guidance for success. You can dive deeper into many of these improvements across the web platform by checking out a number of other sessions, many of which we’ve highlighted today, at this year’s I/O. Thanks for your time, and we look forward to seeing what you build with the evolved capabilities of the modern web. And if you’re watching this during I/O Week, come find us in Adventure. Thanks.
查看原始字幕
[0:05] -I’m Ben. -And I’m Dion. We’re leaders on the Chrome team. [Dion] The two of us have been working together on the web platform for many years. It’s been fun to watch as websites have evolved from simple connected documents to today's rich interactive web apps. The web has become a high performance, general purpose computing platform used by billions of people all across the globe. [Dion] The web’s growth has accelerated in the last year as the pandemic has pushed more of our daily interactions online, triggering a rush to improve web experiences as usage spikes.
[0:40] And for us, this reinforces the importance of the web and the need for all of us to work together to make it better. Now we’ve seen many computing platforms rise and fall over the past decades. One thing is really clear: the old adage evolve or die plays a major role in the ongoing relevance of any platform. Now, the web has evolved a great deal over the years. And looking forward, I think the pace of evolution is accelerating. because it kind of has to to keep pace with tech and society generally. So at Google I/O this year, we have a number of sessions that will bring you up to speed on some of the latest developments in the web.
[1:19] In this session, we’ll give you a quick summary of what we think are the key themes that you should keep in mind this year. And we’ll point you to where you can learn more and go deeper. We're going to start with privacy, explaining how the web is evolving to enable a private browsing experience for all users by default. Next we’ll cover how the web is enabling a new generation of powerful, fast, and seamless web apps and a fantastic user experience. And finally, we’ll summarize the work we’re doing to help developers be productive and successful with the web.
[1:52] So let’s get started with privacy, and we'll do that by talking about sandboxes. Modern browsers are built around the metaphor of a sandbox. Each website you visit is isolated by default from the rest of your system, including from websites and other open tabs just as though we’re surrounded by virtual walls like those of a sandbox in a garden. Now Chrome’s innovated with the browser sandbox model from its earliest days, first by isolating each website into its own process.
[2:23] And more recently, expanding on that to isolate each cross-site iframe on a webpage into its own process. We’re taking this same approach with user data and tracking, building a sort of privacy sandbox that seeks to keep all of your information safe and secure within your browser, resulting in a web where your identity and activity are private by default. We announced the Privacy Sandbox effort two years ago, as an open initiative, a collaboration with the community to bring this vision to life while also being careful to help transition the web ecosystem to a new model in a thoughtful, deliberate way.
[3:07] We’d like to give an update on our progress. Our first step, announced at Google I/O two years ago, was changing the behavior of cookies in Chrome, moving them from being visible across websites by default to being visible only to the same website that set them. Before this change, it wasn’t really clear whether a cookie was intended for first-party or third-party use and browsers needed to observe how cookies were used in the wild to infer their purpose. This also created a security problem because this wide default visibility of cookies exposed users to cross-site request forgery attack based on third parties observing the information in these cookies.
[3:48] Now, developers are required to opt in to use cookies across sites as so-called third-party cookies. And in turn, browsers could then disable such cookies in a very straightforward manner. This privacy-preserving default behavior is now enforced in Chrome, Edge, and, very soon, Firefox. Next we’ve been collaborating with the ecosystem on a new family of APIs that provide privacy-preserving alternatives to use cases that today rely on third-party cookies, such as federated login, personalized ads, and conversion tracking.
[4:23] To clarify how these APIs are approaching this challenge, let’s take a closer look at one of them: the Attribution Reporting API. So a key aspect of any web business is how you grow your user audience, and that often involves advertising to increase traffic. On the other side of those ad dollars, content publishers on the web often rely on revenue from advertisements to make their business model work. Finding out how many users actually clicked on the ad and whether those users subsequently did something like sign up for a newsletter or complete a purchase, is an important part of this model.
[5:01] Traditionally, this measurement is performed by tracking the user from before and after the click across websites with a third-party cookie. So how can we do this in a way that doesn’t involve tracking that user? Well, enter Attribution Reporting. Using this proposed API, no user-identifying data is shared between the sites. Instead, it’s the browser that keeps track of the ad conversion. Later, the browser sends an encrypted report to the advertiser for each of these conversion events.
[5:34] But it adds time delays and noise to these reports to further stifle attempts to identify users. This technique is broadly known as differential privacy. This approach enables both parties to still be able to measure the effectiveness of their ad campaigns and to understand what behavior the ads are able to drive and to do so without tracking the user across sites. Now Attribution Reporting is one of many new API proposals in the Privacy Sandbox project.
[6:06] It’s available for use as a Chrome origin trial’s experiment today, along with several other APIs, And we’ll ship more throughout the course of the year. As we work with all of you across the ecosystem to bring these new APIs to the web platform, we’re also moving forward with preparations to phase out third-party cookies and implementing protection against other forms of covert tracking. And we’ve got more details on what to do with your own cookies today in the technical sessions.
[6:36] So the Privacy Sandbox project represents a substantial evolution of the web platform, enabling privacy by default while also preserving critical web use cases. A change this large and fundamental to the web will take time, but we’re committed to this work and the benefits it will bring to web users globally. The web has evolved into a powerful application platform, enabling anyone with a modern browser to get access to category-leading experiences that load fast and run seamlessly.
[7:11] And devices like Chromebooks show how access to the web could be made affordable, safe, and simple with no need to be an expert at maintaining the underlying operating system. For years, we’ve been on a mission to ensure the web has all of the capabilities needed to bring state-of-the-art computing experiences to the platform. And since we last spoke to you at I/O, the web’s gained a significant array of new capabilities. We'd like to highlight a few of these for you. One area we’ve been working on has been making it easy for users to seamlessly re-engage with web apps.
[7:47] It has been possible for a few years to easily add web apps as icons to native launchers across both mobile and desktop, and it’s one of my favorite platform features. We want to talk about how we’ve deepened this integration between web apps and the underlying OS. With the new app shortcuts feature, web apps can expose quick actions on operating systems that support this feature, such as Android, Chrome OS, Windows, and macOS. And with the Badging API, web apps can give the user a subtle prompt that there’s an opportunity to re-engage by decorating the app’s icon.
[8:24] Soon, we'll be shipping a Chrome origin trial experiment of another new API, Declarative Link Capturing, that enables installed web apps to launch automatically when the user clicks on an appropriate link. This can also prevent multiple instances of the same app from opening so you don’t have like 10 tabs with the same web app in it. We’ve also recently improved Chrome’s web app installation UI. On desktop, we now show an omnibox icon and provide in-product help to explain this feature to users.
[8:57] And on Android, we’ve made the dialogue look richer and more familiar to users, and we’ve made it easy for developers to populate the dialogue with custom images and texts that are specified in the web app’s manifest file. So those are ways that we’re improving the web’s integration with OS launches. We're also adding other OS integrations, such as the Multi-Screen Window Placement API, which allows web apps to discover all of the connected displays and control where the window is placed on those screens.
[9:29] This is actually a pretty handy feature these days for web-based presentation and video conferencing apps. Now web apps can finally read and write to the user's local file system using the File System Access API, enabling apps like Gravit Designer and PhotoBee to provide a much more seamless user experience, persisting state to disk and working with existing files. We’re also working on a new File Handling API that would allow web applications to be registered as file type handlers, enabling users to open files directly in a web app from OS file browsers.
[10:08] We hope to ship an experimental release of this API later this year. Now let’s talk about peripheral devices; things like special-purpose keyboards, game controllers, digital pianos, headsets, and more. Now, the web’s had the ability to communicate with Bluetooth on MIDI devices for a while. But several new APIs now enable support for a broader collection of these devices. Many of these, communicate using the HID protocol. The web now has an API for this in Web HID.
[10:40] Nintendo’s Joy-Con controller is an example of a device that supports this protocol. For gamepad style controllers, the industry standard Gamepad API is now supported by the web as well, and this enables uncompromising gameplay with apps like Stadia in the browser. And you can also use a gamepad to control the Chrome dino in style. The web also now supports serial ports with the Web Serial API. This actually unlocks one of my favorite new use cases: Piper Make.
[11:13] It’s a block-based editor that allows you to program a Raspberry Pi Pico. All you do is simply plug in the device to any computer, open a browser, and off you go. No need to install software or mess with drivers, all thanks to Web Serial. Now with these and other new web capabilities, you can bring deeply integrated, seamless experiences to users everywhere right through the browser. Google Maps holds a special place in our hearts as a singularly influential web app when it first launched over 15 years ago.
[11:46] Maps continues to innovate on the web. Several years ago, they embraced WebGL, enabling hardware-accelerated graphics and delivered a much more powerful Maps UI in the process. Last year, the Maps team enabled those same WebGL-accelerated map capabilities to be used in your web app via the Maps JavaScript API. This year, the team has something new to share. Join me in welcoming Travis McPhail, the team’s engineering lead, who will tell us more about it.
[12:18] We’re constantly amazed by all the ways you’ve used your skill, your creativity, and Google’s knowledge of the real world to build an unbelievable variety of experiences that have truly re-imagined the map. And it's in that spirit today, during the developer keynote, we announced the beta release of two new features that give you unprecedented control of the base map: tilt and rotation, and WebGLOverlayView. With these features, you can manipulate the map in three dimensions for the first time while taking advantage of the power of the same WebGL context we use to render the base map.
[12:57] For the first time ever, you can build not just on top of the map, but you can build with it. Let's take a quick look at how it works. To make things easy, I’m using three.js, a popular web graphics library, to render a 3D object on the map. I've set up a basic web app that loads the map centered on a location in the Yucatán Peninsula of Mexico. And I'm using a map ID so that I can use the vector map and apply some custom styling.
[13:29] The first thing I need to do is implement WebGLOverlayView by extending google.maps.WebglOverlayView. The WebGL overlay exposes a set of hooks into the life cycle of the WebGL rendering context of the base map. For today, we'll keep things as simple as possible and focus on just three of them. The first, onAdd(), is called when the overlay instance is created. The second, onContextRestored(), is called once the rendering context is available.
[14:01] And the third, onDraw(), is what the map and anything else you specify is actually rendered. In onAdd(), I’m going to set up everything that the sscene needs that doesn’t require immediate access to the rendering context. I start by creating a new three.js scene. I also create a camera that represents the view port of the scene. In this case, a perspective camera. Next, the scene needs at least one light source so that any rendered objects are illuminated in the scene.
[14:35] For this example, ambient light is used to equally illuminate all objects in our scene. Now I’m ready to add my 3D object using the GLTFLoader. Once the object is loaded, I scale and rotate it. to have it rendered just right. Then I add it to the scene. In onContextRestored(), I configure the three.js WebGLRenderer, passing it the map’s rendering context and information about the viewport. Once the object renders, I also want to animate the camera to give my users a dynamic view of the object.
[15:13] I called moveCamera in the setAnimationLoop function of the renderer. I also increment tilt, heading, and zoom just a little bit in each frame to create a nice downward spiral motion. All right. Time to render. The three.js camera needs a projection matrix so that it knows how to render latitude and longitude coordinates in the 3D world of the map to the 2D coordinates of the screen. Now, I don’t know about you, but matrix transforms are not my idea of a good time.
[15:47] So, to save you a bunch of math, we hand you a transformer object that has the fromLatLngAltitude function which creates this matrix for you. I pass it the lat-long coordinates where I want the model to appear, and I set the return value as a camera.projectionMatrix. All that’s left is to clear the GL state, tell WebGLOverlayView I want to redraw by calling requestRedraw() on the WebGLOverlayView instance and render the scene.
[16:18] And finally, I create an instance of my class and set the map instance I want it applied to. And this is the result. Not too bad for a few minutes of coding, right? Tilt and rotation and WebGLOverlayView are just the latest way we're delivering on our commitment to you. We have a lot more planned, and we can’t wait to see all the ways you’ll come up with to reimagine the map all over again and show us what’s next. Back to you, Dion. Thanks, Travis.
[16:50] WebGL brought whole new level of graphics performance to the web when it became available several years ago. We are currently working closely with the graphics and web communities on WebGPU, the new next-generation graphics API, designed from the ground up to unlock a whole new level of graphics performance on the web. Taking inspiration from low-level APIs like Vulcan, Metal, and Direct 3D 12, WebGPU is still very experimental that holds exciting promise for the future.
[17:22] Another key performance technology is Web Assembly, which provides a standard for compiling code to a fast and efficient format that can be executed in the browser by modern JavaScript engines like V8. We recently gave Web Assembly a major performance boost by implementing support for SIMD processor instructions in V8, which enables certain classes of apps to run much faster. Google Meet provides a powerful example SIMD in action. Like any video conferencing app, Meet has to pay careful attention to their performance budget.
[17:55] And there’s a constant tension between processing the video in order to enhance it and maintaining a smooth, low-latency stream. Using V8′s experimental origin trial of SIMD, the Meet team achieved a 200% performance gain on their in-browser media processing pipeline. And this in turn, gave them the budget to enable a background blur feature for most of their users that was powered by TensorFlow in the browser. We’re planning to ship SIMD to all Chrome users in the coming months.
[18:26] Now, Web Assembly is also frequently used to bring non-JavaScript codebases to the web, unlocking them for new use cases. For example, the developers behind the offline-first sync engine, Replicache, were able to compile their Rust code to Web Assembly, enabling web developers to seamlessly incorporate it into their web app. To ease with code porting, V8 added threading support to Web Assembly back in 2019. But it was only enabled for desktop operating systems.
[18:57] We’re pleased to share today that Chrome for Android gained Web Assembly threads as of Chrome 88 in January of this year. We’ve also enhanced V8′s Web Assembly debugging experience with support for breakpoints and variable inspection right there in Chrome DevTools. We’re so excited to see what you deliver with a universal runtime that works on client or server is san bugs, and wicked fast. That's Web Assembly. The V8 team has also been hard at work at squeezing even more JavaScript performance out of its engine.
[19:31] So in addition to interpreting JavaScript, V8 also compiles code on the fly for more efficient execution. And the team has implemented a whole new compiler called Sparkplug. Of course, sometimes the best way to improve code execution performance is to not execute any code at all. In this spirit, earlier this year, we shipped a new Chrome feature to some users called intensive timer throttling that detects when a browser tab has been in the background for more than five minutes and as long as the tab isn’t playing any audio or video, Chrome slows down how frequently it executes timer-based JavaScript code on that tab.
[20:10] We've also applied this concept with CSS by shipping support for a new CSS property called content-visibility. When you set this property to auto on an element, you’re giving the browser permission to skip rendering the contents of that element tree if it isn’t currently visible on the user’s display, and this can lead to a dramatic speed boost for content-heavy sites. Now, there’s a ton of innovation happening on the web platform to enable significantly faster runtime performance of your web apps.
[20:40] In addition to the work happening to expand the power and performance of the web, the platform’s also evolving to deliver an instant and seamless experience for users. In Chrome 87, released in November last year, we added a so-called back/forward cache to Chrome on Android, or BFCache for short. BFCache keeps some web pages loaded in memory after you’ve navigated away from them. So if a user clicks back or forward, the page is displayed instantly. And it turns out, one in five navigations on mobile are doing exactly that, moving backwards or forward through the history stack.
[21:18] So this feature drives a really big impact. While today, Chrome’s BFCache implementation is available on Android, it does have some limitations. We are planning to expand it to the Chrome desktop platform soon. Another way we’re expanding instant experiences is by revisiting the notion of pre-rendering pages. Pre-rendering is the technique of loading all of a webpage’s resources and even rendering the DOM before the user clicks on a link So it can be displayed truly instantly.
[21:48] Now this is hard to get right because pre-loading these pages can also cause side effects, if the page does something like sign out or if the page plays audio, then it can also start playing in a mysterious way. Also, it can leak some user information if it's done across sites. But when pre-rendering is done right, it provides this powerful, instant click-through experience for the user. So, we’re working on new approaches to pre-rendering that are private and safe. One of these involves a new pre-rendering API that would enable developers to experiment with this on same site pre-loading later this year.
[22:26] And transitions are another important aspect of the user experience, ensuring that users are able to shift their context as they navigate the web and get right to where they want to go. One fun, simple feature with a big impact is scroll to text, added to Chrome 80 in February of last year. By adding a new type of expression to the end of your URL, browsers can position the viewport to a specific text element and highlight it in some way. Soon we’ll be shipping a version of this API that scrolls to images, and we're exploring other element types too.
[22:59] With the new document transition APIs that are coming to Chrome soon as experiments, we’re also building in support for a number of graphical transitions between elements, enabling the user to perceive a seamless experience as they move between states of your web app. We're also working to make security more seamless on the web. One feature I’m particularly excited about is cross-device one-time passwords for the web. One-time passwords are these numeric codes that some sites can send you to log in.
[23:31] This feature enables you to receive one of these one-time passwords on your Android phone, and then have that automatically transferred to your Chrome browser running on some other device like a laptop. All of these new web capabilities are exciting. But as the pace of web evolution accelerates, so too does the complexity we face as web developers in keeping track of everything. We’re working to make the web easier for developers and partnering with the broader ecosystem to understand and address the platform's top pain points.
[24:03] To understand our latest recommendations for web development, visit web.dev. The site includes detailed tutorials on key topics, the latest news, and it also provides access to our Lighthouse website auditing tool. Now, with Lighthouse, you get a comprehensive report on how to improve your website, across a variety of categories such as performance, accessibility, and SEO. We continually update Lighthouse guidance to give you the very best insights we can.
[24:35] We found that three of Lighthouse’s performance metrics are particularly impactful on the user experience. We call these Core Web Vitals. And collectively, they measure how fast a site displays key content, how responsive the site is for the first interaction, and how much the site’s layout shifts around. Sites across the web were using Core Web Vitals as a North Star for performance and are reporting encouraging results. For example, the Italian publisher GEDI saw an 8% improvement in the bounce rate on their mobile article pages.
[25:13] They did this by implementing a branded placeholder in order to reserve space for ads in their ad slots on the page, which improved their layout stability, and then by deferring loading of some their JavaScript code until after the page was visible, they improved the perceived page loading speed. Web content and commerce platforms. are also investing in Core Web Vitals to improve the performance of all of their hosted sites. For example, Shopify and Wix implemented dashboards in their admin console that puts performance front and center for site owners.
[25:49] The WordPress community has also shipped performance-oriented additions, such as lazy loading for images and iframes. We’ve also updated Site Kit, Google’s official plugin for WordPress, with support for measuring Core Web Vitals, and it also makes specific improvement recommendations to developers. Google Search has also announced that Core Web Vitals will soon be a part of how pages are ranked in search results. We think this is particularly exciting, as it magnifies the benefit of Core Web Vitals to you, the developer.
[26:21] The investment will not only give your users a better experience, but it will help them find your site through such. We spent a good amount of time listening to developers, both in small gatherings and through scaled developer surveys. One of the common themes we consistently hear is the importance to developers of cross-browser compatibility. So this year, we recently announced our participation in a cross-industry effort called Compat2021, which aims to fix the top five browser compatibility pain points as voted on by web developers, which, shockingly, all happen to be CSS related.
[27:00] And speaking of CSS, we’re seeing an exciting renaissance in this area. We even have our own modern-day zen garden. CSS Flexbox and Grid have been embraced by developers as major improvements for creating page layouts, and learnings from years of CSS frameworks like Sass are being baked into the platform, such as nesting. And along with container queries, which is your most requested feature, I think, for CSS, you will be able to create style sheets that are more modular and reusable by enabling rules that are scoped naturally to their local context versus acting so globally.
[27:37] Now, one of Chrome’s most popular features is its suite of built-in developer tools, which give you an incredibly powerful toolkit that can function as your web development copilot. Over the past year, we’ve enhanced DevTools with a bevy of new improvements ranging from a new color picker, improved warnings and linting of PWAs, a Core Web Vitals overlay, dedicated CSS Flexbox debugging, dropped frame visualization, support for CSS and JavaScript, and much more.
[28:09] And DevTools is also a platform because it supports extensions. And one example of a new extension is the Angular DevTools Chrome extension, which provides debugging and performance profiling support that’s specific to Angular apps. So check out our Chrome DevTools session to deep dive into all of this and learn more about our new DevTools features. The web is evolving in fundamental ways so it doesn’t become extinct. It’s becoming private by default with new APIs that protect user privacy, and it also continues to gain powerful new capabilities that broaden what’s possible on the platform, providing for better user experiences.
[28:51] Lastly, we’re committed to partnering with you in the ecosystem as the web evolves to make sure that you’ve got all of the tools and guidance for success. You can dive deeper into many of these improvements across the web platform by checking out a number of other sessions, many of which we’ve highlighted today, at this year’s I/O. Thanks for your time, and we look forward to seeing what you build with the evolved capabilities of the modern web. And if you’re watching this during I/O Week, come find us in Adventure. Thanks.
在 Vidleaf 工作台開啟
檢索字幕、選取句子、複製附時間戳的引用,或按需翻譯。
來源署名
「What's new for the web platform | Keynote」由 Chrome for Developers 發布,採用 CC BY 3.0 授權。來源影片:https://www.youtube.com/watch?v=0UiaD059eqM。此頁呈現影片的文字字幕,由 Vidleaf 加入段落與時間戳。創作者與 Vidleaf 無隸屬或背書關係。頁面若提供 AI 標點、名稱修正或摘要,會分開標示,原始字幕仍可查看。
若你是創作者或權利人,可申請更正或下架: copyright@vidleaf.app (參閱 關於這些頁面)。
最後更新