MP Image Fix 2026

Fix broken images on Mangapark, Comicpark, and Readpark

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/561126/1725892/MP%20Image%20Fix%202026.js

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         MP Image Fix 2026
// @namespace    https://greasyfork.org/users/your-user-id
// @version      2026.3
// @description  Fix broken images on Mangapark, Comicpark, and Readpark
// @author       You
// @match        *://*.mangapark.*/*
// @match        *://*.comicpark.*/*
// @match        *://*.readpark.*/*
// @grant        none
// @run-at       document-end
// @license      MIT
// ==/UserScript==

(() => {
    const origin = location.origin;

    function getSource(img) {
        return (
            img.getAttribute("data-src") ||
            img.getAttribute("data-original") ||
            img.getAttribute("data-lazy-src") ||
            img.src
        );
    }

    function fix(img) {
        if (!(img instanceof HTMLImageElement)) return;
        if (img.dataset.mpFixed) return;

        const src = getSource(img);
        if (!src) return;

        // Match protocol-relative subdomain images like //s1.domain/path
        const match = src.match(/^\/\/s\d+\.[^/]+(\/.+)$/);
        if (!match) return;

        img.src = origin + match[1];
        img.dataset.mpFixed = "1";
    }

    function scan(root = document) {
        root.querySelectorAll("img").forEach(fix);
    }

    // Initial scan
    scan();

    // Observe dynamically added content
    new MutationObserver(mutations => {
        for (const m of mutations) {
            for (const n of m.addedNodes) {
                if (n.nodeType !== 1) continue;
                if (n.tagName === "IMG") fix(n);
                else scan(n);
            }
        }
    }).observe(document.body, {
        childList: true,
        subtree: true
    });
})();