Dynasty Stripper

Force long-strip on Dynasty Scans where applicable

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Dynasty Stripper
// @namespace    http://chireiden.alwinfy.net/
// @version      2026-03-04
// @description  Force long-strip on Dynasty Scans where applicable
// @author       alwinfy
// @match        https://dynasty-scans.com/chapters/*
// @grant        none
// @license      MIT
// @run-at       document-body
// ==/UserScript==

(() => {
    'use strict';

    function makeLongStrip(pagesDiv) {
        if (!window.pages) return;
        const starterImg = pagesDiv.querySelector(":scope>img");

        window.pages.forEach((page) => {
            const newImg = document.createElement("img");
            Object.assign(newImg, {
                alt: page.name,
                src: page.image,
                width: page.width,
                height: page.height,
                className: page.width && page.height && page.height > 2 * page.width ? "tall" : "",
            });
            pagesDiv.appendChild(document.createElement("div")).appendChild(newImg);
        });
        window.pages.length = 1;

        pagesDiv.querySelectorAll(":scope>img, :scope>.pages-list>.page").forEach((node) => {
            node.parentNode.removeChild(node);
        });
    }

    document.querySelectorAll("#chapter-details>.tags>a.label")
        .forEach((node) => node.href.endsWith("/tags/long_strip") && makeLongStrip(document.querySelector("#image")));
})();