asmhentai next page

给asmhentai页面增加翻页按钮

2020/06/13のページです。最新版はこちら。

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name         asmhentai next page
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  给asmhentai页面增加翻页按钮
// @author       L
// @match        https://asmhentai.com/gallery/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    let body = document.body
    let button = document.createElement('button')
    button.textContent = '下一页'
    button.style.position = 'fixed'
    button.style.right = '10px'
    button.style.top = '40%'
    button.style.width = '80px'
    button.style.height = '60px'
    body.appendChild(button)
    let url = location.href
    let num = url.match(/(\d+?)\/$/)[1]
    button.addEventListener('click', function(){
        location.href = url.replace(/(\d+?)\/$/, ++num)
    })
})();