Fix PageUp and PageDown scrolling for ChatGPT

Redirects PageUp and PageDown keys to scroll the conversation window while typing in the input field.

当前为 2025-01-20 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
Devulsky
评分
0 0 0
版本
0.3
创建于
2024-12-01
更新于
2025-01-20
大小
3.5 KB
许可证
MIT
适用于

Rate us
v 0.3 The script now checks for and removes overflow:hidden from the scroll container, making it more adaptable to site changes, but it is still focused on solving the problem in a precise and correct way.

--- Explanation of Changes ---
The original script fixed issues with the PageUp, PageDown, Home, and End keys in ChatGPT but had unintended side effects:
1. Home and End Keys Issue:
- It intercepted the `Home` and `End` keys globally, including in text fields, breaking default browser shortcuts like `Ctrl + Home` and `Shift + End`.
- This was problematic for users relying on standard Windows/browser behavior.

2. Focus Interference:
- The script required the user to click outside the input field for PageUp and PageDown to work, disrupting workflow.

3. Redundant Logic:
- The original code contained duplicated logic for finding the scrollable container and handling key events, making it harder to maintain.

How This Version Fixes These Issues:
- Preserves Home and End Behavior: Home and End keys now retain their default functionality.
- Focus-Free Scrolling: PageUp and PageDown work directly on the conversation window, even when typing in the input field.
- Improved Readability: Functions are now modular and descriptive, with no redundant checks or duplication.
- Minimal Interference: Only PageUp and PageDown are intercepted; all other keys behave as expected.

This approach ensures compatibility with standard shortcuts while fixing the scrolling issues.

This version: https://greasyfork.org/en/scripts/519486

Rate us