Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Reactor Image Redirect
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description Redirect images and videos from .onion to reactor.cc
- // @match http://reactorccdnf36aqvq34zbfzqyrcrpg3eyhilauovitrvmcjovsujmid.onion/*
- // @grant none
- // @run-at document-start
- // ==/UserScript==
- (function() {
- 'use strict';
- function replaceMediaLinks(root) {
- root.querySelectorAll('img, video, source').forEach(el => {
- if (el.src.includes('img1.reactorccdnf36aqvq34zbfzqyrcrpg3eyhilauovitrvmcjovsujmid.onion/pics/')) {
- el.src = el.src.replace(
- 'img1.reactorccdnf36aqvq34zbfzqyrcrpg3eyhilauovitrvmcjovsujmid.onion',
- 'img1.reactor.cc'
- );
- }
- });
- }
- const observer = new MutationObserver(mutations => {
- mutations.forEach(mutation => {
- mutation.addedNodes.forEach(node => {
- if (node.nodeType === 1) replaceMediaLinks(node);
- });
- });
- });
- observer.observe(document.body, { childList: true, subtree: true });
- replaceMediaLinks(document);
- })();
Add Comment
Please, Sign In to add comment