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:
parent
6d25e02cb5
commit
3bdb9251da
3 changed files with 29 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue