Texture Replacer

ok

  1. // ==UserScript==
  2. // @name Texture Replacer
  3. // @version 0.6.7
  4. // @description ok
  5. // @author nyannez
  6. // @match *://*.sploop.io/
  7. // @run-at document-start
  8. // @namespace https://greatest.deepsurf.us/users/960747
  9. // ==/UserScript==
  10.  
  11. //here example
  12.  
  13. const patterns = {
  14. ["/items/platform.png"]: "https://media.discordapp.net/attachments/1046598378647208097/1131063732043264103/0dd9ff4b3ac3a40f.png?ex=65dea72f&is=65cc322f&hm=53b091d4826e17204049df57283e0471a7aacbc3fc13cfe9c3c5c01410140de2&=&format=webp&quality=lossless",
  15. ["/entity/platform.png"]: "https://media.discordapp.net/attachments/1046598378647208097/1131063732043264103/0dd9ff4b3ac3a40f.png?ex=65dea72f&is=65cc322f&hm=53b091d4826e17204049df57283e0471a7aacbc3fc13cfe9c3c5c01410140de2&=&format=webp&quality=lossless"
  16. };
  17.  
  18. const src = Object.getOwnPropertyDescriptor(Image.prototype, "src").set;
  19. Object.defineProperty(Image.prototype, "src", {
  20. set(link) {
  21. const replace = Object.entries(patterns).find(a => link.match(a[0]));
  22. if (replace) {
  23. link = replace[1];
  24. }
  25. return src.call(this, link);
  26. }
  27. })