Last active
April 24, 2019 14:59
-
-
Save dusanmarsa/7953d7203253060fc06fc40a6a898b47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function canExecutePreventDefault () { | |
let supportsPassive = false; | |
try { | |
document.addEventListener("test", null, { get passive() { supportsPassive = true }}); | |
} catch(e) {} | |
return supportsPassive | |
} | |
// https://github.com/Modernizr/Modernizr/blob/a747f33b2bc5db186f18bca4d1d63bf503d3159d/feature-detects/dom/passiveeventlisteners.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment