1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

Use passive event listeners for touch events

Avoid this warning in Chrome console: https://www.chromestatus.com/feature/5745543795965952
This commit is contained in:
Frédéric Guillot 2018-07-10 20:41:27 -07:00
parent 6d25e02cb5
commit 3bdb9251da
3 changed files with 29 additions and 7 deletions

View file

@ -43,4 +43,23 @@ class DomHelper {
return null;
}
static hasPassiveEventListenerOption() {
var passiveSupported = false;
try {
var options = Object.defineProperty({}, "passive", {
get: function() {
passiveSupported = true;
}
});
window.addEventListener("test", options, options);
window.removeEventListener("test", options, options);
} catch(err) {
passiveSupported = false;
}
return passiveSupported;
}
}