Created
December 4, 2023 16:33
-
-
Save nahakiole/6094062a75210268137ae1dc6e29316e to your computer and use it in GitHub Desktop.
Interrupt OpenAI ChatGPT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// function that presses aria-label="Stop generating" when pressing escape key | |
document.addEventListener('keydown', function(event) { | |
if (event.key === 'Escape') { | |
let stopGeneratingButton = document.querySelector('[aria-label="Stop generating"]'); | |
if (stopGeneratingButton) { | |
// trigger click event | |
stopGeneratingButton.click(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment