Rule34 JumpTo

fix rule34 button of jump to

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Rule34 JumpTo
// @namespace    http://tampermonkey.net/
// @version      1.0.2
// @description  fix rule34 button of jump to
// @author       You
// @match        https://rule34video.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=rule34video.com
// @grant        none
// @license      MIT
// ==/UserScript==


(function () {
    'use strict';

    // 循环检测
    load_page()

    function load_page() {
        setTimeout(() => {
            // 寻找JumpTo按钮
            let item_jump_to = document.getElementsByClassName("item jump_to")[0]
            // 检查按钮标签是否正常
            let jump_to_page_num = document.getElementById("jumpTo").value
            
            // 获取按钮子项
            let jump_to_button = item_jump_to.childNodes[5]
            // 获取跳转页码
            let jump_to_button_parameters = jump_to_button.getAttribute("data-parameters")

            // 跳转页码检查
            let parameters = jump_to_button_parameters.split(":")
            // 设置跳转页码
            parameters[parameters.length - 1] = jump_to_page_num
            parameters = parameters.join(":")
            jump_to_button.setAttribute("data-parameters", parameters)

            load_page()
        }, 200)
    }


})();