diff options
Diffstat (limited to 'ui/static/js/dom_helper.js')
-rw-r--r-- | ui/static/js/dom_helper.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ui/static/js/dom_helper.js b/ui/static/js/dom_helper.js index 8a0644b..903e9a9 100644 --- a/ui/static/js/dom_helper.js +++ b/ui/static/js/dom_helper.js @@ -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; + } } |