Sleazy Fork is available in English.

VG prev / next

Use ctrl-left / ctrl-right to move between forum pages, ctrl-shift-left / ctrl-shift-right to jump to the first and last page. On Mac, use Cmd-Ctrl and Shift-Cmd-Ctrl.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         VG prev / next
// @namespace    http://vipergirls.to/
// @version      0.4
// @description  Use ctrl-left / ctrl-right to move between forum pages, ctrl-shift-left / ctrl-shift-right to jump to the first and last page. On Mac, use Cmd-Ctrl and Shift-Cmd-Ctrl.
// @author       tylenoesa
// @license      MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=vipergirls.to
// @match        *://vipergirls.to/forums/*
// @match        *://vipergirls.to/forumdisplay.php*
// @match        *://vipergirls.to/search.php*
// @match        *://vipergirls.to/threads/*
// @match        *://planetviper.club/forums/*
// @match        *://planetviper.club/forumdisplay.php*
// @match        *://planetviper.club/search.php*
// @match        *://planetviper.club/threads/*
// @match        *://viper.to/forums/*
// @match        *://viper.to/forumdisplay.php*
// @match        *://viper.to/search.php*
// @match        *://viper.to/threads/*
// @match        *://viperbb.rocks/forums/*
// @match        *://viperbb.rocks/forumdisplay.php*
// @match        *://viperbb.rocks/search.php*
// @match        *://viperbb.rocks/threads/*
// @match        *://viperkats.eu/forums/*
// @match        *://viperkats.eu/forumdisplay.php*
// @match        *://viperkats.eu/search.php*
// @match        *://viperkats.eu/threads/*
// @match        *://viperohilia.art/forums/*
// @match        *://viperohilia.art/forumdisplay.php*
// @match        *://viperohilia.art/search.php*
// @match        *://viperohilia.art/threads/*
// @match        *://viperproxy.org/forums/*
// @match        *://viperproxy.org/forumdisplay.php*
// @match        *://viperproxy.org/search.php*
// @match        *://viperproxy.org/threads/*
// @match        *://vipervault.link/forums/*
// @match        *://vipervault.link/forumdisplay.php*
// @match        *://vipervault.link/search.php*
// @match        *://vipervault.link/threads/*
// @grant        none
// @run-at       document-body
// ==/UserScript==

(function() {
    'use strict';

    const isMac = window.navigator.platform.toLowerCase().startsWith('mac')
    const dispatch = {
        false: { // no shift
            'ArrowLeft': '.prev_next  a[rel="prev"]',
            'ArrowRight': '.prev_next  a[rel="next"]',
        },
        true: { // with shift
            'ArrowLeft': '.first_last a[rel="start"]',
            'ArrowRight': '.first_last a:not([rel])', // last page element has no 'rel' attribute :-/
        },
    }
    function debounce(func, timeout = 300){ // leading debounce, cancels repeated calls in the timeout window
       var timer = null
       return (...args) => {
           if (timer === null) func.apply(this, args)
           clearTimeout(timer)
           timer = setTimeout(() => {timer = null}, timeout)
       }
    }
    const handler = (e) => {
        if (e.ctrlKey && (!isMac || e.metaKey)) {
            var selector = dispatch[e.shiftKey][e.key]
            var elem = selector && document.querySelector(selector)
            elem && elem.click()
        }
    }
    window.addEventListener('keydown', debounce(handler))
})()