Files
SnowLuma/.pnpm-store/v11/files/40/7e9fbcb6667fbb8dea2f06606dd85efae977509eb92adc6482b9ad10a07f361a41a42e781e36b842bd33987f10fb74441c6691e91009901c803960fc92a12c
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

20 lines
561 B
Plaintext

let passiveSupported = false;
if (typeof window !== 'undefined') {
try {
const options = Object.defineProperty({}, 'passive', {
get() {
passiveSupported = true;
return true;
},
});
// @ts-ignore
window.addEventListener('test', options, options);
// @ts-ignore
window.removeEventListener('test', options, options);
}
catch (err) {
passiveSupported = false;
}
}
export const nonPassive = passiveSupported ? { passive: false } : false;