Advertisement
MeKLiN2

Untitled

Dec 29th, 2023
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Block Wally
  3. // @namespace http://tampermonkey.net/
  4. // @version 2023-12-29
  5. // @description try to take over the world!
  6. // @author You
  7. // @match https://www.shutdown.chat/rooms/downtown
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=shutdown.chat
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. // Add the uuids of the users you want to block here
  13. var blocked_uuids = ["608972616881592", "473915865480751", "755327001444987"];
  14.  
  15. // Get the chatbox element
  16. var chatbox = document.querySelector(".chatbox");
  17.  
  18. // Create a mutation observer to monitor changes in the chatbox
  19. var observer = new MutationObserver(function(mutations) {
  20. // Loop through the added nodes
  21. mutations.forEach(function(mutation) {
  22. for (var i = 0; i < mutation.addedNodes.length; i++) {
  23. var node = mutation.addedNodes[i];
  24. // Check if the node is a chat message
  25. if (node.nodeName === "P" && node.dataset.t === "c") {
  26. // Get the uuid of the user who sent the message
  27. var uuid = node.querySelector(".nm.fcuser").dataset.uuid;
  28. // Check if the uuid is in the blocked list
  29. if (blocked_uuids.includes(uuid)) {
  30. // Hide the message
  31. node.style.display = "none";
  32. }
  33. }
  34. }
  35. });
  36. });
  37.  
  38. // Start observing the chatbox
  39. observer.observe(chatbox, {childList: true});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement