MCPcopy
hub / github.com/videojs/video.js / supportsPassive

Function supportsPassive

src/js/utils/events.js:223–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221let _supportsPassive;
222
223const supportsPassive = function() {
224 if (typeof _supportsPassive !== 'boolean') {
225 _supportsPassive = false;
226 try {
227 const opts = Object.defineProperty({}, 'passive', {
228 get() {
229 _supportsPassive = true;
230 }
231 });
232
233 window.addEventListener('test', null, opts);
234 window.removeEventListener('test', null, opts);
235 } catch (e) {
236 // disregard
237 }
238 }
239
240 return _supportsPassive;
241};
242
243/**
244 * Touch events Chrome expects to be passive

Callers 1

onFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…