Auto Submit Enter for ChatGPT (Including Edit Mode)

Submit prompt in ChatGPT when pressing Enter or Ctrl + Enter, including for edited prompts

当前为 2024-12-26 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

作者
Jonas Müller
评分
0 0 0
版本
0.2
创建于
2024-12-26
更新于
2024-12-26
大小
3.3 KB
许可证
MIT
适用于

This script automatically submits the prompt in ChatGPT when you press the **Enter** key or the **Ctrl + Enter** key combination. It works both for new prompts and for editing previously entered prompts.

It works on the following pages:
- https://chatgpt.com/
- https://chatgpt.com/c/*

This is particularly useful for users who prefer using keyboard shortcuts to interact with ChatGPT, including when editing old prompts.

## Features:
- **Enter**: Submits the prompt.
- **Ctrl + Enter**: Also submits the prompt.
- **Prevents default behavior**: The script prevents a new line from being added when you press **Enter** or **Ctrl + Enter**.
- Works for both **new** prompts and **edited** prompts.

## Instructions:
1. Install [Tampermonkey](https://tampermonkey.net/) extension if you don't have it already.
2. Create a new Tampermonkey script.
3. Paste the code above into the script editor.
4. Save the script.
5. Visit ChatGPT at **https://chatgpt.com/** or any **https://chatgpt.com/c/** page.
6. Now, pressing **Enter** or **Ctrl + Enter** will automatically submit your prompt, including edited ones.

## Notes:
- This script assumes that the ChatGPT input field is a `textarea` and that editable message text areas have the same or similar structure. If the page structure changes in future updates, you may need to adjust the script.
- The script currently only works for the mentioned URLs (`https://chatgpt.com/` and `https://chatgpt.com/c/*`). If you want to extend it to other pages, modify the `@match` directive in the script.
*/