Greasy Fork is available in English.
Forces the entire page to load immediately on ToonGod.
// ==UserScript==
// @name Force Load All Page
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Forces the entire page to load immediately on ToonGod.
// @author Idhtft
// @match https://www.toongod.org/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=toongod.org
// @grant none
// @run-at document-end
// @license MIT
// ==/UserScript==
(function() {
'use strict';
const TARGET_SELECTOR = '.reading-content img';
function forceLoadImages() {
const images = document.querySelectorAll(TARGET_SELECTOR);
images.forEach(img => {
const dataSrc = img.getAttribute('data-src') ||
img.getAttribute('data-lazy-src') ||
img.getAttribute('data-original');
if (dataSrc && img.src !== dataSrc) {
img.src = dataSrc;
img.style.opacity = '1';
img.style.display = 'block';
img.classList.add('loaded');
img.classList.remove('lazy', 'lazyload');
img.removeAttribute('data-src');
img.removeAttribute('data-lazy-src');
}
});
}
window.addEventListener('load', forceLoadImages);
forceLoadImages();
const observer = new MutationObserver((mutations) => {
let shouldRun = false;
mutations.forEach((mutation) => {
if (mutation.addedNodes.length) {
shouldRun = true;
}
});
if (shouldRun) {
forceLoadImages();
}
});
const container = document.querySelector('body');
if (container) {
observer.observe(container, { childList: true, subtree: true });
}
let count = 0;
const interval = setInterval(() => {
forceLoadImages();
count++;
if(count > 5) clearInterval(interval);
}, 2000);
})();