← Back to release summary

VisibilityStateEntry

Category
Performance
Type
New or changed feature
Status
Enabled by default (Chrome 115)
Intent stage
Prepare to ship

Summary

Exposes visibility state (visible/hidden) in the performance timeline. The timeline would always have an entry with a startTime of 0 and the initial visibility state, plus entries corresponding to any visibility state change.

Motivation

Currently the Page Visibility API enables querying the current visibility state of the page and adding an event handler which will be executed when the visibility state changes in the future. However, this creates a gap for developers that are interested in knowing the full visibility states of the page, from the beginning of the page load: the initial visibility state and any very early visibility state changes that occur before JavaScript has had a chance to query the visibility state or register an event handler.

Standards & signals

Explainers: https://docs.google.com/document/d/1l5kHiJRkdQwEN-CYI5_mUNODhQVB5rCyjN4jHDdXDHA/edit

View on chromestatus.com