About passive event listeners
devlucky
3736

I personally use this code:

/* Feature detection */
var passiveIfSupported = false;

try {
 window.addEventListener(“test”, null, Object.defineProperty({}, “passive”, { get: function() { passiveIfSupported = { passive: false }; } }));
} catch(err) {}

window.addEventListener(‘scroll’, function(e) {
 /* do something */
 // can’t use event.preventDefault();
 console.count(‘scroll’);
}, passiveIfSupported );

It’s a backward compatible and it’s easy to implement.