ChatGPT Enter Fix

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

Verze ze dne 06. 12. 2022. Zobrazit nejnovější verzi.

// ==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 }
  );
})();