Created
November 12, 2024 20:33
-
-
Save chamlis/8d4da0a438a756250e4ab09bfd6c8b8b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
javascript:(function(){ | |
const join_time = Date.now(); | |
function debounce_msg(m){ | |
m.style.visibility = Date.parse(m.querySelector("time").dateTime) < join_time ? "hidden" : "initial"; | |
} | |
function debounce_msgs(records){ | |
document.querySelectorAll("ol[data-list-id='chat-messages']>li").forEach(debounce_msg); | |
} | |
let observer = new MutationObserver(debounce_msgs); | |
observer.observe(document, {subtree: true, childList: true}); | |
debounce_msgs(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment