Keep ChatGPT Alive 保持ChatGPT一直有效

Keeps ChatGPT responsive by automatically inputting a question every x minutes

目前为 2023-02-02 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Keep ChatGPT Alive 保持ChatGPT一直有效
  3. // @namespace https://github.com/new4u
  4. // @version 0.4
  5. // @description Keeps ChatGPT responsive by automatically inputting a question every x minutes
  6. // @author new4u本爷有空
  7. // @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com
  8. // @match https://chat.openai.com/chat
  9. // @connect chat.openai.com
  10. // @match https://chat.openai.com/*
  11. // @grant none
  12. // @copyright 2015-2022, new4u
  13. // @license GPL-3.0-only
  14. // ==/UserScript==
  15.  
  16. (function () {
  17. 'use strict';
  18.  
  19. setInterval(function () {
  20. // input a question into the chat box
  21. const textarea = document.querySelector("textarea");
  22. textarea.value = "继续";
  23. textarea.dispatchEvent(new KeyboardEvent("keydown", {
  24. bubbles: true,
  25. cancelable: true,
  26. key: "Enter",
  27. code: "Enter",
  28. keyCode: 13
  29. }));
  30. }, 120000); // input a question every 1 minutes (1 minutes * 60 seconds/minute * 1000 milliseconds/second)
  31. })();