Fix onclick handler for blurred videos on Chrome

This commit is contained in:
Noah Petherbridge 2023-09-24 11:55:31 -07:00
parent a856b9d01b
commit 6c618d1a0c

View File

@ -133,9 +133,11 @@ document.addEventListener('DOMContentLoaded', () => {
node.addEventListener("click", e => { node.addEventListener("click", e => {
if (node.classList.contains("blurred-explicit")) { if (node.classList.contains("blurred-explicit")) {
node.classList.remove("blurred-explicit"); node.classList.remove("blurred-explicit");
if (node.tagName.toLowerCase() !== "video") {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
} }
}
}); });
// Video tag: autoplay is disabled when blurred, onClick doesn't fire, // Video tag: autoplay is disabled when blurred, onClick doesn't fire,