Greasy Fork

来自缓存

Greasy Fork is available in English.

ChatGPT Enter Fix

This Chrome extension addresses the issue where ChatGPT sends text even when the Enter key is pressed during Japanese conversion.

当前为 2022-12-06 提交的版本,查看 最新版本

// ==UserScript==
// @name       ChatGPT Enter Fix
// @namespace    http://tampermonkey.net/
// @description  This Chrome extension addresses the issue where ChatGPT sends text even when the Enter key is pressed during Japanese conversion.
// @version      1.1
// @author       d-engine
// @match      https://chat.openai.com/chat
// ==/UserScript==
 
(function() {
  const textarea = document.querySelector('textarea[data-id="root"]');
  textarea?.addEventListener(
    "keydown",
    (event) => {
      if (event.key === "Enter" && event.isComposing) {
        event.stopPropagation();
      }
    },
    { capture: true }
  );
})();