zetlnd

Untitled

Mar 15th, 2025
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Reactor Redirect
  3. // @version 1.0
  4. // @description Redirects to .onion site if post is censored.
  5. // @match https://old.reactor.cc/*
  6. // @grant none
  7. // ==/UserScript==
  8.  
  9. (function() {
  10. 'use strict';
  11.  
  12. const observer = new MutationObserver((mutations) => {
  13. mutations.forEach((mutation) => {
  14. if (mutation.addedNodes) {
  15. mutation.addedNodes.forEach((node) => {
  16. if (node.nodeType === Node.ELEMENT_NODE && node.textContent.includes("Реактор вернул все еще зацензуренный пост")) {
  17. const currentUrl = window.location.href;
  18. if (currentUrl.startsWith("https://old.reactor.cc/post/")) {
  19. const newUrl = currentUrl.replace("https://old.reactor.cc", "http://reactorccdnf36aqvq34zbfzqyrcrpg3eyhilauovitrvmcjovsujmid.onion");
  20. window.location.href = newUrl;
  21. }
  22. }
  23. });
  24. }
  25. });
  26. });
  27.  
  28. observer.observe(document.body, { childList: true, subtree: true });
  29. })();
  30.  
Add Comment
Please, Sign In to add comment