Skip to content

Commit

Permalink
Added chatgpt.focusChatbar()
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Jun 23, 2024
1 parent ef4c0f2 commit 5075892
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ const chatgpt = { // eslint-disable-line no-redeclare
},

extractCode: function() { chatgpt.code.extract(); },
focusChatbar: function() { chatgpt.getChatBox()?.focus() },

Check failure on line 610 in chatgpt.js

View workflow job for this annotation

GitHub Actions / eslint

Missing semicolon

generateRandomIP: function() {
const ip = Array.from({length: 4}, () => Math.floor(chatgpt.randomFloat() * 256)).join('.');
Expand Down
11 changes: 11 additions & 0 deletions docs/USERGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
- [startNewChat](#startnewchat)
- [stop](#stop)
- [DOM related](#dom-related)
- [focusChatbar](#focuschatbar)
- [getChatBox](#getchatbox)
- [getContinueGeneratingButton](#getcontinuegeneratingbutton)
- [getFooterDiv](#getfooterdiv)
Expand Down Expand Up @@ -1086,6 +1087,16 @@ chatgpt.stop();

## DOM related

### focusChatbar

Focuses the chatbar.

Example code:

```js
chatgpt.focusChatbar();
```

### getChatBox

Returns the chat input as an HTML element.
Expand Down

0 comments on commit 5075892

Please sign in to comment.