Greasy Fork镜像 支持简体中文。

Discord Wrapper Modifier

Modifies the .wrapper_cc5dd2 class only inside selected list items in Discord

  1. // ==UserScript==
  2. // @name Discord Wrapper Modifier
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description Modifies the .wrapper_cc5dd2 class only inside selected list items in Discord
  6. // @author You
  7. // @match https://discord.com/*
  8. // @grant none
  9. // @license MIT / Broadband. Not allowed for commercial use or for sharing / taking claim of product. We are legally allowed to sue on section 44.9 of the international Copyright act of 1994.
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. function modifyWrapper() {
  16. let listItems = document.querySelectorAll('.listItemWrapper__91816.selected__91816');
  17. listItems.forEach(listItem => {
  18. let wrapper = listItem.querySelector('.wrapper_cc5dd2');
  19. if (wrapper) {
  20. console.log("Modifying wrapper:", wrapper);
  21.  
  22. // Set opacity of all children to 0
  23. wrapper.querySelectorAll('*').forEach(child => {
  24. child.style.opacity = "0";
  25. });
  26.  
  27. // Add background image
  28. wrapper.style.backgroundImage = "url(https://i.imgur.com/FTckCa9.png)";
  29. wrapper.style.zIndex = "9999";
  30. wrapper.style.borderRadius = "10px";
  31. wrapper.style.backgroundSize = "contain";
  32. wrapper.style.backgroundRepeat = "no-repeat";
  33. wrapper.style.backgroundPosition = "center";
  34. }
  35. });
  36. }
  37.  
  38. // Wait for elements to exist
  39. function waitForElement(selector, callback) {
  40. const observer = new MutationObserver((mutations, obs) => {
  41. if (document.querySelector(selector)) {
  42. obs.disconnect();
  43. callback();
  44. }
  45. });
  46. observer.observe(document.body, { childList: true, subtree: true });
  47. }
  48.  
  49. waitForElement('.listItemWrapper__91816.selected__91816', modifyWrapper);
  50.  
  51. // Observe changes in Discord UI
  52. const observer = new MutationObserver(() => modifyWrapper());
  53. observer.observe(document.body, { childList: true, subtree: true });
  54.  
  55. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址