Skip to content

Commit

Permalink
Removed chatgpt.history methods outdated as of yesterday
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed May 1, 2024
1 parent 634758c commit 6358c49
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 77 deletions.
19 changes: 1 addition & 18 deletions chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -938,31 +938,14 @@ const chatgpt = { // eslint-disable-line no-redeclare
navigator.systemLanguage || navigator.userLanguage || ''; },

history: {
activate: function() { this.isOff() ? this.toggle() : console.info('Chat history is already enabled!'); },
deactivate: function() { this.isOn() ? this.toggle() : console.info('Chat history is already disabled!'); },

isOn: function() {
const navDivs = document.querySelectorAll('nav div'),
offDiv = [...navDivs].find(div => div.textContent.includes('Chat History is off')) || {};
return offDiv.classList.toString().includes('invisible');
},

isOff: function() { return !this.isOn(); },

isLoaded: function() {
return new Promise(resolve => {
const checkChatHistory = () => {
if (document.querySelector('nav')) resolve(true);
else setTimeout(checkChatHistory, 100);
};
checkChatHistory();
});},

toggle: function() {
for (const navBtn of document.querySelectorAll('nav button')) {
if (/chat history/i.test(navBtn.textContent)) {
navBtn.click(); return;
}}}
});}
},

instructions: {
Expand Down
59 changes: 0 additions & 59 deletions docs/USERGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,7 @@
- [unminify `async`](#unminify-async)
- [write `async`](#write-async)
- [history `api`](#history-api)
- [isOn](#ison)
- [isOff](#isoff)
- [activate](#activate-1)
- [deactivate](#deactivate-1)
- [isLoaded](#isloaded-async-1)
- [toggle](#toggle)
- [instructions `api`](#instructions-api)
- [add `async`](#add-async)
- [clear `async`](#clear-async)
Expand Down Expand Up @@ -1450,50 +1445,6 @@ Example code:

API related to the chat history.

### isOn

Returns a boolean value. `true` if the chat history is enabled, `false` otherwise.

Example code:

```js
if (chatgpt.history.isOn()) {
// Do something
}
```

### isOff

Returns a boolean value. `true` if the chat history is disabled, `false` otherwise.

Example code:

```js
if (chatgpt.history.isOff()) {
// Do something
}
```

### activate

Activates the chat history.

Example code:

```js
chatgpt.history.activate();
```

### deactivate

Deactivates the chat history.

Example code:

```js
chatgpt.history.deactivate();
```

### isLoaded `async`

Resolves a promise when chat history has finished loading.
Expand All @@ -1507,16 +1458,6 @@ Example code:
})();
```

### toggle

Toggles the chat history.

Example code:

```js
chatgpt.history.toggle();
```

## instructions `api`

### add `async`
Expand Down

0 comments on commit 6358c49

Please sign in to comment.