Reddit Snap Scroll

Keyboard navigation (W/S), highlight, open (E), hide previous post

作者
Farid Ismailov
今日安裝
0
安裝總數
0
評價
0 0 0
版本
2025.09.04.3
建立日期
2025-09-04
更新日期
2025-09-04
尺寸
17.5 KB
授權條款
Personal
腳本執行於
  • Script name: reddit-snap-scroll.user.js
  • Scope: Enhances browsing on Reddit with keyboard navigation, focus highlight, and optional post hiding.
  • Key features:
    • Keyboard navigation: W = previous post, S = next post
    • Open post: E (also works on RU layout: У) opens the focused post in a background tab
    • Carousel control: A = previous slide, D = next slide (where applicable)
    • Highlight: The focused article is visually outlined
    • Hide previous on S: When moving down, the previously focused post is hidden
  • How hiding works:
    • Primary: calls Reddit’s GraphQL endpoint (/svc/shreddit/graphql) with the existing csrf_token cookie and postId (t3_*) extracted from the DOM
    • Fallback: opens the post overflow menu and clicks “Hide” (handles Shadow DOM and localized labels)
  • Installation:
    • Install Tampermonkey
    • Add the script reddit-snap-scroll.user.js to Tampermonkey and enable it
    • Open Reddit and use W/S to navigate
  • Configuration (inside script):
    • HIDE_PREVIOUS_ON_NEXT: hide the previously focused post on S (enabled)
    • AUTO_HIDE_ENABLED: auto-hide based on scrolling (disabled by default)
    • You can adjust highlight style and center offset if needed
  • Compatibility:
    • Designed for the new Reddit UI (shreddit-* components)
    • Requires being logged in for hiding to work (uses your existing cookies)
  • Privacy and safety:
    • Uses only your browser session and Reddit’s own endpoints
    • No data is sent to third parties; no storage beyond in-memory flags
  • Troubleshooting:
    • Ensure you are on new Reddit, logged in, and have a csrf_token cookie
    • If “Hide” text is localized, the script already matches common variants; report unusual labels to refine
    • If nothing hides on S, check the Tampermonkey console for errors and refresh the page