docs/security/overlay-policy.md
Chrome features should not include cross-origin overlays that fully obscure an active web page's content area, even temporarily.
If the active page is partially obscured, we should provide sufficient cues to the user that the active page is still present and active. Partial overlays can be dangerous or confusing as well and should be designed carefully with input from security and Chrome UX.
Chrome has had multiple features in the past that attempt to show a full page, cross-origin overlay above an active web page. In practice, these have created dangerous situations with a large variety of bugs and security issues that are difficult to address in general, so we have adopted a security UX policy that disallows full page overlays.
Features that have used or proposed full page overlays:
chrome://interstitials) used an overlay
approach for many years, with dozens of bugs
due to the active page underneath. This feature eventually migrated to use
committed error pages instead in 448486, as
documented
here.
There are many things that an active but hidden page can do to pose security or functional issues while the overlay is displayed, including but not limited to:
This list is not exhaustive and the capabilities of web pages continue to expand over time, so it is difficult to prevent all observable or dangerous behavior while a user is unaware that a page is still present. This would be a fail-open approach requiring us to diagnose and fix all problematic cases. Attempts to do so in the past (e.g., Prerendering v1) have resulted in an unsustainable maintenance burden.
A hidden active page also affects the user's mental model: they are more likely to think the page has been unloaded, ending up confused if Chrome later reveals it has been active but hidden.
Even temporary cases, such as showing an overlay until a timeout, can pose risks to users, such as a "hot mic" situation if a video call appears to end but is still in progress.
There are other situations where active web pages may continue to run while not visible to the user, such as in a background tab. Chrome's UI indicates the change of security context to the user in these cases (e.g., using a different tab and address bar contents), and continues to indicate the previous page exists via the tab strip or tab switcher. In contrast, full-page overlays within a given tab imply to the user that the active page is no longer present, even though it continues to run.
BFcache and Prerendering are two other features that keep pages in a hidden but frozen or restricted state. These pages are not fully active as in the overlay case above. However, not all pages can be put into this frozen or restricted state, depending on which APIs are in use, whether the page opts out, which other pages are in the same process, etc. In such cases, BFcache and Prerendering evict or discard the page. As a result, freezing a page is not a general technique that can be used when showing an overlay above any arbitrary page.