Ensure node is an Element in DOMPurify hook

ce67f3a658f50a169dbbbc032d7e52744ff180e2

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -0Showing whitespace changes
public/script.js+4 -0
@@ -366,6 +366,10 @@ DOMPurify.addHook('uponSanitizeElement', (node, _, config) => {
366366 return;
367367 }
368368
369+ if (!(node instanceof Element)) {
370+ return;
371+ }
372+
369373 let mediaBlocked = false;
370374
371375 switch (node.tagName) {