Files
NapCatQQ/.pnpm-store/v3/files/29/c23b7f309f448de37de2ad7c4c65aaf3f8ccbe6a0d7789ca58d6ce93f27836588f7a6d1c9e63dba69bd2c6cf6433ab3ce8822552aa559491afdce6f7aaa8a6
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

13 lines
439 B
Plaintext

/**
* Assumes true for a non-browser env, otherwise makes a best effort
* @link https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState
*/
export function isDocumentVisible(): boolean {
// `document` may not exist in non-browser envs (like RN)
if (typeof document === 'undefined') {
return true
}
// Match true for visible, prerender, undefined
return document.visibilityState !== 'hidden'
}