Document: hidden property
目录
The Document.visibilityState property provides an alternative way to determine whether the page is hidden.
Value
A Boolean value, true if the page is hidden, and false otherwise.
Examples
document.addEventListener("visibilitychange", () => {
console.log(document.hidden);
// Modify behavior…
});