2020-12-10 09:40:46 +00:00
|
|
|
// Test via a getter in the options object to see if the passive property is accessed
|
|
|
|
let supportsPassive = false;
|
|
|
|
try {
|
2023-08-30 14:48:17 +00:00
|
|
|
const opts = Object.defineProperty({}, 'passive', {
|
2020-12-10 09:40:46 +00:00
|
|
|
get() {
|
|
|
|
supportsPassive = true;
|
|
|
|
},
|
|
|
|
});
|
|
|
|
window.addEventListener('testPassive', null, opts);
|
|
|
|
window.removeEventListener('testPassive', null, opts);
|
|
|
|
} catch (e) {}
|
|
|
|
|
|
|
|
export default supportsPassive;
|