Skip to content

Instantly share code, notes, and snippets.

@JimLiu
Created September 18, 2023 02:12
Show Gist options
  • Save JimLiu/f2917be33c3a978cbcacee6f70a45f7f to your computer and use it in GitHub Desktop.
Save JimLiu/f2917be33c3a978cbcacee6f70a45f7f to your computer and use it in GitHub Desktop.

Revisions

  1. JimLiu created this gist Sep 18, 2023.
    21 changes: 21 additions & 0 deletions chatgpt-auto-click-continue.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    (function () {
    const observer = new MutationObserver(() => {
    // Find the button of 'Continue generating'
    [...document.querySelectorAll("button.btn")].forEach((btn) => {
    if (btn.innerText.includes("Continue generating")) {
    console.log("Found the button of 'Continue generating'");
    setTimeout(() => {
    console.log("Clicked it to continue generating after 1 second");
    btn.click();
    }, 1000);
    }
    });
    });

    // Start observing the dom change of the form
    observer.observe(document.forms[0], {
    attributes: false,
    childList: true,
    subtree: true,
    });
    })()