ChatGPT Submit Edit on Enter Key

Trigger Send button on Enter keypress without modifiers

  1. // ==UserScript==
  2. // @name ChatGPT Submit Edit on Enter Key
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Trigger Send button on Enter keypress without modifiers
  6. // @match https://chat.openai.com/*
  7. // @grant none
  8. // @license MIT
  9.  
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. document.addEventListener("keydown", (e) => {
  16. if (e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.altKey) {
  17. e.preventDefault();
  18. const btn = [...document.querySelectorAll('button.btn.relative.btn-primary')]
  19. .find(b => b.innerText.trim() === 'Send');
  20. if (btn && !btn.disabled) btn.click();
  21. else console.log('Button not found');
  22. }
  23. });
  24. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址