You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
387 B
14 lines
387 B
4 years ago
|
// Test via a getter in the options object to see if the passive property is accessed
|
||
|
let supportsPassive = false;
|
||
|
try {
|
||
|
let opts = Object.defineProperty({}, 'passive', {
|
||
|
get() {
|
||
|
supportsPassive = true;
|
||
|
},
|
||
|
});
|
||
|
window.addEventListener('testPassive', null, opts);
|
||
|
window.removeEventListener('testPassive', null, opts);
|
||
|
} catch (e) {}
|
||
|
|
||
|
export default supportsPassive;
|