When Energy Saver is active, Chrome will freeze a "browsing context group" that has been hidden and silent for >5 minutes if any subgroup of same-origin frames within it exceeds a CPU usage threshold, unless it: - Provides audio- or video-conferencing functionality (detected via microphone, camera or screen/window/tab capture or an RTCPeerConnection with an 'open' RTCDataChannel or a 'live' MediaStreamTrack). - Controls an external device (detected via usage of Web USB, Web Bluetooth, Web HID or Web Serial). - Holds a Web Lock or an IndexedDB connection that blocks a version update or a transaction on a different connection. Freezing consists of pausing execution. It is formally defined in the Page Lifecycle API. The CPU usage threshold will be calibrated to freeze approximately 10% of background tabs when Energy Saver is active.
Interoperability: This feature does not expose new capabilities to the Web, so it has low chances of creating situations in which the same HTML/CSS/Js/... behaves differently in different browsers. That being said, we invite other browsers vendors that already shipped "tab freezing" to share and discuss their opt-out rules, which will help offer consistent behavior for web developers across browsers, avoiding situations where a site's background functionality works correctly in some browsers but not others. Compatibility: This feature may affect existing sites with background functionality. However, breaking some functionality to extend battery life is in line with user expectations when "Energy Saver" is active. We're interested in Web developer feedback to adjust our opt-outs and minimize avoidable breakages. "Energy Saver" can be disabled via the the "BatterySaverModeAvailability" enterprise policy.
No Ergonomics Risks identified.
No action is required to support browsers that don't freeze pages.
A frame can observe when it is frozen, either directly (via the “freeze” event) or indirectly (timer runs later than expected, server doesn’t receive a ping…). When the decision to freeze a frame depends on observations made on other cross-origin frames (crossing CPU usage threshold, using Web API that opt-outs from freezing) there is a risk of leaking information across origins. Multiple solutions were considered to balance security and ergonomy requirements. We finally landed on "freezing a browsing context group based on independent observations made on groups of same-origin/same-page frames in that browsing context group". Pros & cons + All frames on a page are in the same “frozen” state (does not break Web devs assumptions). + All frames that can synchronously script each other are in the same “frozen” state (does not break Web devs assumptions). + Not aggregating CPU usage across origins minimizes leaks, because an attacker can’t vary its own CPU usage to precisely measure the CPU usage of another origin. - Leaks Web API usage across cross-origin frames.
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
The frozen state of a tab is displayed in the "Loading state" column of about:discards. The reasons that prevent a tab from being frozen (e.g. usage of WebRTC) are displayed in the bubble that appears when clicking on a "page" at about:discards/graph (see Freezing > cannot_freeze_reasons). The #freezing-on-energy-saver and #freezing-on-energy-saver-testing features at about:flags can be used to test this intervention.
Chrome for Android already freezes pages in the background (not tied to Energy Saver). This proposal brings freezing to desktop.
DevTrial on desktop | 131 |