Auto Scroll/Jump Back Helper (Scroll Position Saver/Tracker)

Detects sudden scroll jumps and restores your previous position automatically or on click. (+ Settings)

Autor
Sascha Nemeth
Instalaciones diarias
0
Instalaciones totales
0
Calificaciones
0 0 0
Versión
0.3
Creado
17/4/2025
Actualizado
17/4/2025
Tamaño
17,3 KB
Licencia
MIT
Funciona en
Todos los sitios

On very long webpages (such as online comics, manhwa, or similar) it is not uncommon for unexpected scroll jumps to occur. This can happen due to content loading, ads, rendering glitches or hardware-issues.

The problem: You lose your current reading position and must manually scroll back.

This userscript monitors the scroll positions and offers a way to restore the previous position quickly and conveniently.


What this script does

  • Continuously tracks the scroll position at set intervals.
  • When a large jump in scroll position is detected (configurable pixel threshold), a return button is created to jump back to the last known position.
  • A maximum number of buttons are shown at once (default: 10).
  • Optionally, the script can automatically jump back without user interaction (AutoJump).
  • Includes a configurable UI for live adjustments.
  • The script only activates on greasyfork.org and all other websites/pages whose domain or full URL contains specific keywords (configurable whitelist, defaults to: manga, manhua, webtoon, bato).

Features

  • Scroll position tracking with adjustable interval
  • Return buttons for previous positions (stackable, configurable max count)
  • AutoJump option for automatic return after scroll jumps
  • Persistent settings stored via GM_setValue / GM_getValue
  • Adjustable button and UI placement with nine anchor positions
  • Clean and responsive settings menu accessible from within the page
  • Whitelist-based activation using URL/domain keyword matching

Usage

  1. Install the script using a user script manager such as Tampermonkey or similar.
  2. Visit a webpage where the domain or full URL contains one of the default whitelist keywords:
    manga, manhua, webtoon
  3. Once loaded, a settings button will appear in the bottom-left corner by default. This can be changed.
  4. Start scrolling. If a jump larger than the defined threshold occurs, a button will appear to return to the previous position.
  5. Use the settings menu (⚙️) to configure behavior as needed.

Default Configuration Values

Setting Default Value
Whitelist ["manga", "manhua", "webtoon"]
Pixel Threshold 3000
Scroll Tracking Interval 3000 ms
Max Return Buttons 10
Max Scroll History 400
AutoJump Enabled false
AutoJump Delay 1000 ms
Return Button Anchor right center
Settings Button Anchor bottom left
UI Offsets (X/Y) 10 / 10 px

Notes

  • Return buttons can be manually removed or cleared all at once.
  • The AutoJump toggle can be controlled via a small button next to the settings icon.
  • All UI elements (settings button, return buttons) can be repositioned using anchor presets and offsets.
  • This script uses Tampermonkey's storage API (GM_*) for saving settings persistently.

Status

I'm not happy with some details, as, like the settings-menu. But this script works, so I will call it just a stable enough version, aka. Beta. It has been used successfully for some weeks for personal reading comfort, but small bugs or improvements may occur.


Background Story

I use an old Apple Magic Trackpad. For over half a year, I realized a strange scroll/jump behavior and I tried to rule out other possible causes: the website, browser, extensions, user error, or alternative input devices. But in the end, it seems my old trackpad simply has a minor flaw.

It works flawlessly 99% of the time (but occasionally, on long very, very long pages, it makes a sudden and disruptive jump). Ever since I wrote and gradually refined this script, that’s no longer a problem anymore, why I like to share it now.

This way, I can keep enjoying both benefits: the device itself (despite its small quirk) and this kind of content (extensive, long-form pages).