Guest User

cat2fat

a guest
Sep 2nd, 2024
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. // ==UserScript==
  2. // @name cat2fat
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description redirect catbox to fatbox
  6. // @author anon
  7. // @match https://www.voat.xyz/*
  8. // @match https://www.upgoat.net/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14. var links = document.querySelectorAll('a,img,source');
  15. if (links) {
  16. links.forEach(s => {
  17. if (s.href !== undefined && s.href.startsWith("https://files.catbox.moe/")) {
  18. s.href = s.href.replace('catbox', 'fatbox');
  19. }
  20. if (s.src !== undefined && s.src.startsWith("https://files.catbox.moe/")) {
  21. s.src = s.src.replace('catbox', 'fatbox');
  22. if(s.parentNode.tagName === "VIDEO") {
  23. s.parentNode.load();
  24. }
  25. }
  26. });
  27. }
  28. })();
  29.  
  30.  
Add Comment
Please, Sign In to add comment