Exposes to PerformanceObserver the initial visibility state of a page plus any visibility state changes that the page goes through. Also adds support for this to the observe() method's buffered flag.
Interoperability and Compatibility
Low risk, as this API should not be user-visible and we expect other major browser vendors to implement the API at some point, as they all currently implement document.visibilityState.
This API has been discussed in the W3C WebPerf WG. Minutes here: https://docs.google.com/document/d/1PMbJ8kUHtrrCZxHJfKXcV0YQeTxyMOH4AORgd2VuhOw/editGecko
: Positive (https://github.com/whatwg/html/pull/8206#issuecomment-1499406083
: No signalWeb developers
: No signalsOther signals
This will frequently be used in tandem with other performance APIs, so the choice to integrate with PerformanceObserver seems natural in that regard.
This API does not introduce any security/privacy risks that would not be already present with the Page Visibility API.
WebView application risks
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).