Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Replace and Enlarge Image
- // @namespace http://tampermonkey.net/
- // @version 1.1
- // @description Replace specific image and enlarge it
- // @match *://*/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- const originalSrc = "https://d35aaqx5ub95lt.cloudfront.net/vendor/70a4be81077a8037698067f583816ff9.svg";
- const newSrc = "https://files.catbox.moe/57xv08.jpg";
- const newWidth = "200px"; // You can change this to whatever size you want
- const newHeight = "auto"; // Keeps aspect ratio, or specify e.g. "150px"
- function replaceAndResizeImage() {
- const images = document.querySelectorAll('img.sOuBs');
- images.forEach(img => {
- if (img.src === originalSrc) {
- img.src = newSrc;
- img.style.width = newWidth;
- img.style.height = newHeight;
- }
- });
- }
- // Run on initial load
- replaceAndResizeImage();
- // Observe DOM changes in case the image is loaded dynamically
- const observer = new MutationObserver(replaceAndResizeImage);
- observer.observe(document.body, {
- childList: true,
- subtree: true
- });
- })();
Add Comment
Please, Sign In to add comment