Discourse Prevent Jump on Reply

Prevent Discourse from jumping after posting a reply by intercepting the reply button click and forcing shiftKey, keeping scroll position and context.

目前為 2025-12-04 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

作者
Pipecraft
評價
0 0 0
版本
0.1.2
建立日期
2025-12-03
更新日期
2025-12-04
尺寸
5.7 KB
授權條款
MIT
腳本執行於

Discourse Prevent Jump on Reply

Prevent Discourse from jumping to the latest post after you submit a reply. The script intercepts reply actions and forces shiftKey behavior to keep your current scroll position and context. Includes a per‑site toggle and auto language for the UI label.

中文版

Features

  • Prevents post‑submission jump; keeps current position
  • Intercepts both reply button clicks and Cmd/Ctrl + Enter hotkey
  • Per‑site toggle next to the reply button; off by default
  • Toggle state persisted per domain via userscript storage (GM.getValue/GM.setValue)
  • Auto label language (English/Simplified Chinese) based on Discourse UI language

Supported Sites

Runs on these Discourse forums:

Installation

  1. Install a user script manager:
  2. Install the script:

Usage

  • On the reply composer, a checkbox appears next to the reply button:
    • Label: “Prevent jump to latest post” (auto‑localized)
    • Default: Off
    • When enabled, the script intercepts reply actions and keeps position
  • Works for both clicking the reply button and pressing Cmd/Ctrl + Enter
  • Shift override: if you manually hold Shift, the script does not alter behavior

Compatibility

Tested on modern browsers with Tampermonkey/Violentmonkey and Discourse‑based forums.

Changelog

v0.1.0

  • Initial release: button and hotkey interception, per‑site toggle, auto language

More Useful Scripts

License

MIT License — see the repository LICENSE file.

Contributing

Issues and pull requests are welcome!

Related Links