Advertisement
MeKLiN2

Untitled

Dec 29th, 2023
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 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. // 608972616881592", "473915865480751", "755327001444987" one of these is wally
  13. // 956020454044026 sheets1,
  14. // Add the uuids of the users you want to block here
  15. var blocked_uuids = ["956020454044026"];
  16.  
  17. // Get the chatbox element
  18. var chatbox = document.querySelector(".chatbox");
  19.  
  20. // Create a mutation observer to monitor changes in the chatbox
  21. var observer = new MutationObserver(function(mutations) {
  22. // Loop through the added nodes
  23. mutations.forEach(function(mutation) {
  24. for (var i = 0; i < mutation.addedNodes.length; i++) {
  25. var node = mutation.addedNodes[i];
  26. // Check if the node is a chat message
  27. if (node.nodeName === "P" && node.dataset.t === "c") {
  28. // Get the uuid of the user who sent the message
  29. var uuid = node.querySelector(".nm.fcuser").dataset.uuid;
  30. // Check if the uuid is in the blocked list
  31. if (blocked_uuids.includes(uuid)) {
  32. // Hide the message
  33. node.style.display = "none";
  34. }
  35. }
  36. }
  37. });
  38. });
  39.  
  40. // Start observing the chatbox
  41. observer.observe(chatbox, {childList: true});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement