Files
Basilosaurusrex f027651f9b main repo
2025-11-24 18:09:40 +01:00

20 lines
561 B
JavaScript

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;