-
-
Save rlemon/076c0c848e4c45094166 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const userid = 3577236; | |
const parseNode = (node) => { | |
if( node.classList && node.classList.contains('user-container') && node.classList.contains(`user-${userid}`) ) { | |
[].forEach.call(node.querySelectorAll('.content'), message => { | |
message.textContent = message.textContent.split(' ').map(w=>{ | |
return w.split('').sort(() => Math.random()>.5).join(''); | |
}.sort(() => Math.random()>.5)).join(' '); | |
}); | |
} | |
}; | |
[].forEach.call(document.querySelectorAll('#chat .user-container'), parseNode); | |
new MutationObserver(records => | |
records.forEach(record => [].forEach.call(record.addedNodes, parseNode)) | |
).observe(document.getElementById('chat'), { childList: true, subtree: true }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment