Skip to content

Commit

Permalink
Added chatgpt.getScrollToBottomButton()`
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed May 9, 2024
1 parent 3349558 commit d924510
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,7 @@ const chatgpt = { // eslint-disable-line no-redeclare

getResponseFromAPI: function(chatToGet, responseToGet) { return chatgpt.response.getFromAPI(chatToGet, responseToGet); },
getResponseFromDOM: function(pos) { return chatgpt.response.getFromDOM(pos); },
getScrollToBottomButton: function() { return document.querySelector('button[class*="cursor"][class*="bottom"]'); },
getSendButton: function() { return document.querySelector('form button[class*="bottom"]'); },

getStopGeneratingButton: function() {
Expand Down
12 changes: 12 additions & 0 deletions docs/USERGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
- [getContinueGeneratingButton](#getcontinuegeneratingbutton)
- [getNewChatLink](#getnewchatlink)
- [getRegenerateButton](#getregeneratebutton)
- [getScrollToBottomButton](#getscrolltobottombutton)
- [getSendButton](#getsendbutton)
- [getStopGeneratingButton](#getstopgeneratingbutton)
- [Library APIs](#library-apis)
Expand Down Expand Up @@ -1102,6 +1103,17 @@ const regenButton = chatgpt.getRegenerateButton();
regenButton.click();
```

### getScrollToBottomButton

Returns the button which scrolls to bottom as an HTML element.

Example code:

```js
const scrollToBottomBtn = chatgpt.getScrollToBottomButton();
scrollToBottomBtn.click();
```

### getSendButton

Returns the button which sends the message as an HTML element.
Expand Down

0 comments on commit d924510

Please sign in to comment.