Automatically navigate next/previous pages for gallery sites by vertical scrolling, with scroll buffer for turning pages. Forked from [Gallery Scroll Navigator] by [Yukiteru]. User can now apply this script to any custom websites.
Automatically navigate next/previous pages for gallery sites by vertical scrolling, with scroll buffer (buffer that slows you down when turning pages).
This script is forked from Gallery Scroll Navigator by Yukiteru. All credit to the original creator.
New features: Able to Add New Supported Websites, 2 Navigation Modes, Adapted to Both desktop/mobile devices
Default supported websites: hitomi, pixiv, nhentai, exhentai, imhentai
All Settings are Optional
A Setting UI Panel is made to manage all settings.
Site Manager: user can define new websites for this script
//match in the script OR in the script setting*://* to //match to match all websitesFunction Body of the Page Turning Function:
The core logic function getPageButton(direction) {...} used in the script for page turning. User need to write this function (the {...} part) in Javascript.
getPageButton function takes direction, and return the Next/Prevous Page button or Null (if no button is found)
direction (string), either 'next' or 'prev', depending on the scrolling direction. This is passed to the function automatically from the scriptPage button (HTML element), return Next button if 'next' is input, Previous button if 'prev' is inputNull if no button can be found. E.g., Previous button cannot be found when user is at the 1st pageExample:
A template function body suitable for website with a still Next/Previous button. No Previous button at 1st page; No Next button at last page.
const selector = direction === 'next' ? 'CSS_selector_of_Next_button' : 'CSS_selector_of_Previous_button'; const pageButton = document.querySelector(selector); return pageButton || null;For more about CSS selector, please see FAQ
This script was developed with AI assistance. While tested, unforeseen issues or bugs may exist. Users assume all risks associated with using this script. The author is not responsible for any direct or indirect losses resulting from its use. Please comply with local laws and regulations.