add chats
This commit is contained in:
parent
8f43531b47
commit
94328e0b93
12 changed files with 372 additions and 14 deletions
|
@ -70,10 +70,12 @@ let mutationObserver = new MutationObserver(records => {
|
|||
// NOTE: Added nodes may contain children which also need to be processed.
|
||||
// Collect those that have [data-cast] on them and apply spells to them.
|
||||
for (let addedNode of record.addedNodes) {
|
||||
if (addedNode.getAttribute("data-cast") != null) {
|
||||
mutatedNodes.add(addedNode);
|
||||
if (!(addedNode instanceof Text)) {
|
||||
if (addedNode.getAttribute("data-cast") != null) {
|
||||
mutatedNodes.add(addedNode);
|
||||
}
|
||||
addedNode.querySelectorAll("[data-cast]").forEach(element => mutatedNodes.add(element));
|
||||
}
|
||||
addedNode.querySelectorAll("[data-cast]").forEach(element => mutatedNodes.add(element));
|
||||
}
|
||||
applySpells(mutatedNodes);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue