if ((img.alt.includes('hamster.is') || img.alt.includes('hamster.is'))) { if (img.alt.includes('thumb-')) { img.alt = img.alt.replace('thumb-', 'image-'); } }
// Check if the image is from the specific domains and ends with '.th.jpg', '.th.png', '.md.jpg', or '.md.png' if ((img.src.includes('hamster.is') || img.src.includes('hamster.is'))) { if (img.src.endsWith('.th.jpg') || img.src.endsWith('.md.jpg')) { img.src = img.src.replace(/\.th\.jpg$|\.md\.jpg$/, '.jpg'); } else if (img.src.endsWith('.th.png') || img.src.endsWith('.md.png')) { img.src = img.src.replace(/\.th\.png$|\.md\.png$/, '.png'); } // Also replace in the 'alt' attribute if present if (img.alt) { if (img.alt.endsWith('.th.jpg') || img.alt.endsWith('.md.jpg')) { img.alt = img.alt.replace(/\.th\.jpg$|\.md\.jpg$/, '.jpg'); } else if (img.alt.endsWith('.th.png') || img.alt.endsWith('.md.png')) { img.alt = img.alt.replace(/\.th\.png$|\.md\.png$/, '.png'); } } } }); })()}) ();
Here is updated version of the script that works with Empornium's new image host hamster.is
// ==UserScript==
elements on the page
// @name EMP Replace Thumbnail Images with Full Images Modified
// @namespace http://tampermonkey.net/
// @version 1.3_modified
// @description Replace all thumbnail images on with full images
// @author bighype
// @include /^https:\/\/www\.empornium\.(me|sx|is)\/torrents\.php\?id=\d+/
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
// Get all
const images = document.querySelectorAll('img');
images.forEach(img => {
images.forEach(img => {
//img.src = img.src.replace('thumb-', 'image-');
if ((img.src.includes('hamster.is') || img.src.includes('hamster.is'))) {
if (img.src.includes('thumb-')) {
img.src = img.src.replace('thumb-', 'image-');
}
}
//alt.src = alt.src.replace('thumb-', 'image-');
if ((img.alt.includes('hamster.is') || img.alt.includes('hamster.is'))) {
if (img.alt.includes('thumb-')) {
img.alt = img.alt.replace('thumb-', 'image-');
}
}
// Check if the image is from the specific domains and ends with '.th.jpg', '.th.png', '.md.jpg', or '.md.png'
if ((img.src.includes('hamster.is') || img.src.includes('hamster.is'))) {
if (img.src.endsWith('.th.jpg') || img.src.endsWith('.md.jpg')) {
img.src = img.src.replace(/\.th\.jpg$|\.md\.jpg$/, '.jpg');
} else if (img.src.endsWith('.th.png') || img.src.endsWith('.md.png')) {
img.src = img.src.replace(/\.th\.png$|\.md\.png$/, '.png');
}
// Also replace in the 'alt' attribute if present
if (img.alt) {
if (img.alt.endsWith('.th.jpg') || img.alt.endsWith('.md.jpg')) {
img.alt = img.alt.replace(/\.th\.jpg$|\.md\.jpg$/, '.jpg');
} else if (img.alt.endsWith('.th.png') || img.alt.endsWith('.md.png')) {
img.alt = img.alt.replace(/\.th\.png$|\.md\.png$/, '.png');
}
}
}
});
})()})
();