exhentai flow viewer

This scripts helps you to view a gallery in a single page, from up to down.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         exhentai flow viewer
// @namespace    http://tampermonkey.net/
// @version      1.1
// @author       PokemonMaster802
// @match        https://exhentai.org/s/*
// @description  This scripts helps you to view a gallery in a single page, from up to down.
// @locale       en
// ==/UserScript==

var container;  // The <div> to hold images, intending to inherit it's style.
var parser;

function getNext(currURL, currDOC) {
    'use strict';
    var nextURL = currDOC.getElementById('next').href;

    // The last page has the next url directing to itself.
    if (currURL === nextURL) {
        console.log('Reach the last page');
        return;
    }

    // Prepare http request for the next page.
    var nextPage = new XMLHttpRequest();
    nextPage.onreadystatechange = function() {
        if (nextPage.readyState == 4) {
            if (nextPage.status == 200) {
                var doc = parser.parseFromString(nextPage.responseText, 'text/html');
                var img = doc.getElementById('img');
                img.style.paddingTop = '1em';
                container.append(img);
                setTimeout(getNext, 500, nextURL, doc);
            }
            else {
                console.log('Failed to fetch ' + nextURL + ': ' + nextPage.status);
            }
        }
    };
    nextPage.open("GET", nextURL, false);
    nextPage.send();
}

(function() {
    parser = new DOMParser();
    container = document.getElementById('i3');
    getNext(document.URL, document);
})();