Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 15x 15x 15x 15x 15x | /** * The DOM API, of which addEventListener is a part, is not defined by the * ECMAScript language specification, so it is unrelated to Babel; thus, the * necessity for this function. * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener * * This function is used for safely detecting passive option support, but * could be extended for any option on addEventListener. */ export let passiveSupported = false try { const options = { // This function will be called when the browser // attempts to access the passive property. get passive() { passiveSupported = true return false } } window.addEventListener("test", null, options) window.removeEventListener("test", null, options) } catch (err) { passiveSupported = false } |