Home Page › Forums › General Chat › Little Userscript for jpg4 and jpg6 Images
Tagged: Userscript
- This topic has 4 replies, 3 voices, and was last updated 2 years, 6 months ago by
Lewd18Ratio.
-
AuthorPosts
-
March 17, 2024 at 10:48 PM #2064556
Hey everyone,
I created a simple userscript to address an issue I encounter here. It's annoying when images hosted on simp4.jpg.church and simp6.jpg.church don't load properly due to outdated URLs.
This script automatically replaces these old URLs with the correct ones (simp4.host.church and simp6.host.church) so you can view the images hassle-free.
You can download the userscript here.
You can use any Userscipt extension you want. (Tampermonkey, Greazyfork, Violentmonkey, ...)
Here also the code if you want to paste it directly
// ==UserScript== // @name Replace Image Host URL from JPG4 and JPG6 // @version 0.1 // @description Replace image host URLs from simp4.jpg.church and simp6.jpg.church to their corresponding host URLs // @author L18R // @match https://zonegfx.com/* // @grant none // ==/UserScript== (function() { 'use strict'; function replaceImageHostURL() { const images = document.querySelectorAll('img[src*="https://simp4.jpg.church/"], img[src*="https://simp6.jpg.church/"]'); images.forEach(img => { try { img.src = img.src.replace('https://simp4.jpg.church/', 'https://simp4.host.church/') .replace('https://simp6.jpg.church/', 'https://simp6.host.church/'); } catch (error) { console.error('Error replacing image host URL:', error); } }); } setTimeout(replaceImageHostURL, 250); const observer = new MutationObserver(mutationsList => { mutationsList.forEach(mutation => { if (mutation.type === 'childList') { replaceImageHostURL(); } }); }); observer.observe(document.body, { subtree: true, childList: true }); })();March 17, 2024 at 11:44 PM #2064562This works great! Thank you so much for sharing this gem 🙂
March 17, 2024 at 11:52 PM #2064564I'm glad it helps you 😀
March 18, 2024 at 11:12 AM #2064683This is amazing, thank you very much.
March 18, 2024 at 9:52 PM #2064747I am happy to hear it 😀
Edit: read* ;D
-
AuthorPosts
- You must be logged in to reply to this topic.


