Sleazy Fork is available in English.

18H Hentai Manga Autoload

autoload hentai manga and CG images in one page on 18h.mm-cg.com

Version vom 10.06.2014. Aktuellste Version

// ==UserScript==
// @name           18H Hentai Manga Autoload
// @description    autoload hentai manga and CG images in one page on 18h.mm-cg.com
// @include        http://*.servik.com/*
// @include        http://18h.mm-cg.com/*
// @version 0.0.1.20140610101643
// @namespace https://greasyfork.org/users/2233
// ==/UserScript==

var wnd = window
var doc = wnd.document
var loc = location
var href = loc.href

var load_imgs = function()
{
    doc.body.innerHTML = ''
    var d = doc.createDocumentFragment()
    for(var i=0, len=imgs.length; i<len; i++)
    {
        var img = new Image()
        img.id = i
        img.onerror = function(){ this.onerror = null; this.style.display = 'none' }
        img.src = imgs[i]
        img.style.cssText = 'display: block; margin-left: auto; margin-right: auto'
        img.width = wnd.innerWidth * 0.70
        d.appendChild(doc.createTextNode('p. '+i))
        d.appendChild(doc.createElement('BR'))
        d.appendChild(img)
        d.appendChild(doc.createElement('BR'))
    }
    doc.body.appendChild(d)
}

if(/^http:\/\/18h\.mm-cg\.com\//.test(href))
{
    if(href.indexOf('.html')==-1)
    {
        try {
            doc.getElementById('fwin_dialog_submit').click()
            close_btns = doc.getElementsByClassName('mmad_drift_title')
            close_btns[1].click()
        } catch(e) {}

        var lnks = doc.getElementsByTagName('A')
        for(var i=lnks.length-1; i>=0; i--)
        {
            lnks[i].target = '_blank'
            lnks[i].addEventListener('click', function(evt){
                evt.preventDefault()
            }, false)
            lnks[i].addEventListener('mousedown', function(evt){
                clickstart = evt.timeStamp
            }, false)
            lnks[i].addEventListener('mouseup', function(evt){
                clickstop = evt.timeStamp- clickstart
                if(clickstop >= 100)
                {
                    var t = this.innerHTML.replace(/<[^>]*>/g,'').replace(/^\s*/g,'').replace(/\s*$/g,'').replace(/&[^;]*;/g,'').replace(/\s+/g,' ')
                    if(t == '') { return }
                    var key = '18h'
                    var sub = /.*\/(.*)/.exec(href)[1]
                    if(sub) { key = key + '_' + sub }
                    var c = key + '=' + t + ' p.' + prompt('Title: ' + t + '\nEnter the page number: ','0') + '; expires=Fri, 31 Dec 9999 23:59:59 GMT;'
                    if(/ p.[0-9]/.test(c)) { doc.cookie = c }
                    return
                }
                wnd.open(this.href, '_blank')
            }, false)
        }
        throw 'exit'
    }
    if(href.indexOf('#')==-1) { loc.href = loc.href + '#' }
    var imgs = []
    var wnd = unsafeWindow
    if(typeof wnd.Large_cgurl != 'undefined') { imgs = wnd.Large_cgurl } else { alert("Cannot find the image links."); throw 'exit' }
    imgs.shift()
    load_imgs()

    throw 'exit'
}
else if(/^http:\/\/.*?\.servik\.com\//.test(href))
{
    if(href.indexOf('#')==-1) { loc.href = loc.href + '#' }
    var imgs = []
    href = href.replace(loc.hash,"")
    for(var i=1; i<=9; i++) { imgs[i] = href + '00' + i + '.jpg' }
    for(var i=10; i<=99; i++) { imgs[i] = href + '0' + i + '.jpg' }
    for(var i=100; i<=999; i++) { imgs[i] = href + '' + i + '.jpg' }
    imgs.shift()
    load_imgs()

    throw 'exit'
}