Greasy Fork

Greasy Fork is available in English.

yande.re keypress q-e-double-skip 双页跳转

使用键 Q 向前跳转2页,使用键 E 向后跳转2页

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         yande.re keypress q-e-double-skip 双页跳转
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  使用键 Q 向前跳转2页,使用键 E 向后跳转2页
// @author       rowink
// @match        https://yande.re/post
// @match        https://yande.re/post?page*
// @grant        none
// ==/UserScript==

(function () {
    "use strict";
    let url = window.location.href;
    let page = parseInt(url.split("=")[1]);
    page = page > 0 ? page : 1;
    let pagination = document.getElementById("paginator").getElementsByClassName("pagination")[0];
    let pages = pagination.getElementsByTagName("a");
    let last_page = pages[pages.length - 2].textContent;
    window.addEventListener('keypress', function (e) {
        if (e.code == "KeyQ" && page > 1) {
            window.location.href = "https://yande.re/post?page=" + (page - 2);
        }
        if (e.code == "KeyE" && page < last_page) {
            window.location.href = "https://yande.re/post?page=" + (page + 2);
        }
    });
})();