1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

refactor(js): remove an outdated check for {passive: true}

According to https://caniuse.com/?search=passive,
all browsers released after 2016 do support passive event listeners,
so no need to check for its presence.
This commit is contained in:
Julien Voisin 2025-01-15 04:18:11 +00:00 committed by GitHub
parent 3b317b0b80
commit 8c3a9184ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 31 deletions

View file

@ -25,23 +25,4 @@ class DomHelper {
const elements = document.querySelectorAll(selector);
return [...elements].filter((element) => this.isVisible(element));
}
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;
}
}