您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Send messages on ChatGPT with Cmd+Enter, use Enter for new lines
// ==UserScript== // @name ChatGPT Cmd+Enter Send and Enter New Line // @namespace http://tampermonkey.net/ // @version 0.2 // @description Send messages on ChatGPT with Cmd+Enter, use Enter for new lines // @author 15d23 // @match https://chat.openai.com/* // @grant none // @license GPL // @created 2023-04-17 // @updated 2023-05-01 // ==/UserScript== (function () { 'use strict'; function handleKeyPress(event) { const inputBox = document.querySelector('textarea'); if (event.key === 'Enter' && !event.metaKey && inputBox) { event.stopPropagation(); } } function overrideEnterKey() { const inputBox = document.querySelector('textarea'); if (inputBox) { inputBox.removeEventListener('keydown', handleKeyPress, true); inputBox.addEventListener('keydown', handleKeyPress, true); } } const observer = new MutationObserver(overrideEnterKey); observer.observe(document, { childList: true, subtree: true }); })();