zetlnd

Untitled

Mar 15th, 2025
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Reactor Image Redirect
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Redirect images and videos from .onion to reactor.cc
  6. // @match http://reactorccdnf36aqvq34zbfzqyrcrpg3eyhilauovitrvmcjovsujmid.onion/*
  7. // @grant none
  8. // @run-at document-start
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. function replaceMediaLinks(root) {
  15. root.querySelectorAll('img, video, source').forEach(el => {
  16. if (el.src.includes('img1.reactorccdnf36aqvq34zbfzqyrcrpg3eyhilauovitrvmcjovsujmid.onion/pics/')) {
  17. el.src = el.src.replace(
  18. 'img1.reactorccdnf36aqvq34zbfzqyrcrpg3eyhilauovitrvmcjovsujmid.onion',
  19. 'img1.reactor.cc'
  20. );
  21. }
  22. });
  23. }
  24.  
  25. const observer = new MutationObserver(mutations => {
  26. mutations.forEach(mutation => {
  27. mutation.addedNodes.forEach(node => {
  28. if (node.nodeType === 1) replaceMediaLinks(node);
  29. });
  30. });
  31. });
  32.  
  33. observer.observe(document.body, { childList: true, subtree: true });
  34. replaceMediaLinks(document);
  35. })();
Add Comment
Please, Sign In to add comment