@kudoai/chatgpt.js 2.9.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -51
- package/chatgpt.js +105 -106
- package/dist/chatgpt.min.js +3 -3
- package/docs/README.md +74 -51
- package/docs/USERGUIDE.md +81 -54
- package/package.json +7 -6
- package/starters/chrome/LICENSE.md +2 -2
- package/starters/chrome/docs/README.md +5 -5
- package/starters/chrome/docs/SECURITY.md +2 -2
- package/starters/chrome/extension/lib/chatgpt.js +105 -106
- package/starters/chrome/extension/manifest.json +1 -1
- package/starters/chrome/extension/popup/index.html +1 -1
- package/starters/docs/README.md +2 -2
- package/starters/greasemonkey/LICENSE.md +2 -2
- package/starters/greasemonkey/chatgpt.js-greasemonkey-starter.user.js +4 -4
- package/starters/greasemonkey/docs/SECURITY.md +2 -2
- package/starters/media/images/icons/tampermonkey-icon28.png +0 -0
- package/starters/media/images/icons/violentmonkey-icon100.png +0 -0
package/docs/README.md
CHANGED
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
[](https://github.com/KudoAI/chatgpt.js/stargazers)
|
|
46
46
|
[](https://github.com/KudoAI/chatgpt.js/blob/main/LICENSE.md)
|
|
47
47
|
[](https://github.com/KudoAI/chatgpt.js/commits/main)
|
|
48
|
-
|
|
48
|
+

|
|
49
|
+
[](https://github.com/KudoAI/chatgpt.js/tree/v3.0.0/dist/chatgpt.min.js)
|
|
49
50
|
[](https://www.codefactor.io/repository/github/kudoai/chatgpt.js)
|
|
50
51
|
[](https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=kudoai_chatgpt.js)
|
|
51
52
|
[](https://github.com/sindresorhus/awesome-chatgpt#javascript)
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
|
|
63
64
|
</div>
|
|
64
65
|
|
|
65
|
-
<span style="color: white">chatgpt.js</span> is a <span style="color: white">powerful</span> JavaScript library that allows for <span style="color: white">super easy</span> interaction w/ the ChatGPT DOM.
|
|
66
|
+
<span style="color: white"><b>chatgpt.js</b></span> is a <span style="color: white">powerful</span> JavaScript library that allows for <span style="color: white">super easy</span> interaction w/ the ChatGPT DOM.
|
|
66
67
|
|
|
67
68
|
- Feature-rich
|
|
68
69
|
- Object-oriented
|
|
@@ -83,7 +84,7 @@
|
|
|
83
84
|
|
|
84
85
|
```js
|
|
85
86
|
(async () => {
|
|
86
|
-
await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@
|
|
87
|
+
await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.0/dist/chatgpt.min.js');
|
|
87
88
|
// Your code here...
|
|
88
89
|
})();
|
|
89
90
|
```
|
|
@@ -92,7 +93,7 @@
|
|
|
92
93
|
|
|
93
94
|
```js
|
|
94
95
|
var xhr = new XMLHttpRequest();
|
|
95
|
-
xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@
|
|
96
|
+
xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.0/dist/chatgpt.min.js');
|
|
96
97
|
xhr.onload = function () {
|
|
97
98
|
if (xhr.status === 200) {
|
|
98
99
|
var chatgptJS = document.createElement('script');
|
|
@@ -108,19 +109,19 @@ function yourCode() {
|
|
|
108
109
|
}
|
|
109
110
|
```
|
|
110
111
|
|
|
111
|
-
### <img style="margin: 0 2px -0.065rem 0" height=17 src="https://
|
|
112
|
+
### <img style="margin: 0 2px -0.065rem 0" height=17 src="https://media.chatgptjs.org/images/icons/platforms/tampermonkey/icon28.png?a3e53bf7"><img style="margin: 0 2px -0.035rem 1px" height=17.5 src="https://media.chatgptjs.org/images/icons/platforms/violentmonkey/icon25.png?a3e53bf7"> Greasemonkey:
|
|
112
113
|
|
|
113
114
|
> **Note** _To use a starter template: [kudoai/chatgpt.js-greasemonkey-starter](https://github.com/KudoAI/chatgpt.js-greasemonkey-starter)_
|
|
114
115
|
|
|
115
116
|
```js
|
|
116
117
|
...
|
|
117
|
-
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@
|
|
118
|
+
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.0/dist/chatgpt.min.js
|
|
118
119
|
// ==/UserScript==
|
|
119
120
|
|
|
120
121
|
// Your code here...
|
|
121
122
|
```
|
|
122
123
|
|
|
123
|
-
### <img style="margin: 0 2px -1px 0" height=16 src="https://
|
|
124
|
+
### <img style="margin: 0 2px -1px 0" height=16 src="https://media.chatgptjs.org/images/icons/platforms/chrome/icon16.png?8c852fa5"> Chrome:
|
|
124
125
|
|
|
125
126
|
> **Note** _To use a starter template: [kudoai/chatgpt.js-chrome-starter](https://github.com/KudoAI/chatgpt.js-chrome-starter)_
|
|
126
127
|
|
|
@@ -189,7 +190,7 @@ chatgpt.get('reply', 'last');
|
|
|
189
190
|
|
|
190
191
|
Each call equally fetches the last response. If you think it works, it probably will... so just type it!
|
|
191
192
|
|
|
192
|
-
If it didn't, check out the extended [userguide](https://github.com/KudoAI/chatgpt.js/blob/
|
|
193
|
+
If it didn't, check out the extended [userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.0.0/docs/USERGUIDE.md), or simply submit an [issue](https://github.com/KudoAI/chatgpt.js/issues) or [PR](https://github.com/KudoAI/chatgpt.js/pulls) and it will be integrated, ezpz!
|
|
193
194
|
|
|
194
195
|
<img height=8px width="100%" src="https://media.chatgptjs.org/images/separators/gradient-aqua.png?78210a7">
|
|
195
196
|
|
|
@@ -203,58 +204,79 @@ https://github.com/KudoAI/chatgpt.js/assets/10906554/f53c740f-d5e0-49b6-ae02-3b3
|
|
|
203
204
|
|
|
204
205
|
#
|
|
205
206
|
|
|
206
|
-
### <
|
|
207
|
+
### <img src="https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png" width=20> [AmazonGPT](https://amazongpt.kudoai.com)
|
|
208
|
+
|
|
209
|
+
> Add AI to Amazon shopping.
|
|
210
|
+
<br>[Install](https://greasyfork.org/scripts/500663-amazongpt) /
|
|
211
|
+
[Readme](https://amazongpt.kudoai.com/#readme) /
|
|
212
|
+
[Discuss](https://amazongpt.kudoai.com/discussions)
|
|
213
|
+
|
|
214
|
+
### <picture><source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://media.autoclearchatgpt.com/images/icons/openai/white/icon48.png?cece513"><img width=21 src="https://media.autoclearchatgpt.com/images/icons/openai/black/icon48.png?cece513"></picture> [Autoclear ChatGPT History](https://autoclearchatgpt.com) <a href="https://github.com/awesome-scripts/awesome-userscripts#chatgpt" target="_blank" rel="noopener"><img src="https://media.autoclearchatgpt.com/images/badges/awesome/badge.svg?2c0d9fc" style="margin:0 0 -2px 5px"></a>
|
|
207
215
|
|
|
208
216
|
> Auto-clear your ChatGPT query history for maximum privacy.
|
|
209
217
|
<br>[Install](https://docs.autoclearchatgpt.com/#-installation) /
|
|
210
218
|
[Readme](https://docs.autoclearchatgpt.com/#readme) /
|
|
211
219
|
[Discuss](https://github.autoclearchatgpt.com/discussions)
|
|
212
220
|
|
|
213
|
-
### <img src="https://media.bravegpt.com/images/icons/bravegpt/icon48.png"
|
|
221
|
+
### <img width=24 src="https://media.bravegpt.com/images/icons/bravegpt/icon48.png?0a9e287"> [BraveGPT](https://bravegpt.com) <a href="https://www.producthunt.com/posts/bravegpt?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-bravegpt" target="_blank" rel="noopener"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=385630&theme=light" style="width: 112px; height: 24px; margin:0 0 -4px 5px;" width="112" height="24" /></a>
|
|
214
222
|
|
|
215
|
-
>
|
|
223
|
+
> Adds AI answers to Brave Search (powered by GPT-4o!)
|
|
216
224
|
<br>[Install](https://docs.bravegpt.com/#-installation) /
|
|
217
225
|
[Readme](https://docs.bravegpt.com/#readme) /
|
|
218
226
|
[Discuss](https://github.bravegpt.com/discussions)
|
|
219
227
|
|
|
220
|
-
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://
|
|
228
|
+
### <picture><source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://media.chatgptautocontinue.com/images/icons/openai/white/icon48.png?7bbd222"><img width=21 src="https://media.chatgptautocontinue.com/images/icons/openai/black/icon48.png?7bbd222"></picture> [ChatGPT Auto-Continue ⏩](https://chatgptautocontinue.com) <a href="https://github.com/awesome-scripts/awesome-userscripts#chatgpt" target="_blank" rel="noopener"><img src="https://media.chatgptautocontinue.com/images/badges/awesome/badge.svg?3c80c0c" style="margin:0 0 -3px 3px"></a>
|
|
221
229
|
|
|
222
230
|
> Automatically continue generating multiple ChatGPT responses.
|
|
223
231
|
<br>[Install](https://docs.chatgptautocontinue.com/#-installation) /
|
|
224
232
|
[Readme](https://docs.chatgptautocontinue.com/#readme) /
|
|
225
233
|
[Discuss](https://github.chatgptautocontinue.com/discussions)
|
|
226
234
|
|
|
227
|
-
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://
|
|
235
|
+
### <picture><source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-talk@eb7f285/assets/images/icons/openai/white/icon64.png"><img width=21 src="https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-talk@eb7f285/assets/images/icons/openai/black/icon64.png"></picture> [ChatGPT Auto-Talk 📣](https://github.com/adamlui/chatgpt-auto-talk)
|
|
236
|
+
|
|
237
|
+
> Auto-play ChatGPT responses.
|
|
238
|
+
<br>[Install](https://greasyfork.org/scripts/500940-chatgpt-auto-talk) /
|
|
239
|
+
[Readme](https://github.com/adamlui/chatgpt-auto-talk#readme) /
|
|
240
|
+
[Discuss](https://github.com/adamlui/chatgpt-auto-talk/discussions)
|
|
241
|
+
|
|
242
|
+
### <picture><source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://media.chatgptautorefresh.com/images/icons/openai/white/icon48.png?a45cf1e"><img width=21 src="https://media.chatgptautorefresh.com/images/icons/openai/black/icon48.png?a45cf1e"></picture> [ChatGPT Auto Refresh ↻](https://chatgptautorefresh.com) <a href="https://github.com/awesome-scripts/awesome-userscripts#chatgpt" target="_blank" rel="noopener"><img src="https://media.chatgptautorefresh.com/images/badges/awesome/badge.svg?1080f44" style="margin:0 0 -2px 5px"></a>
|
|
228
243
|
|
|
229
244
|
> Keeps ChatGPT sessions fresh to eliminate network errors + Cloudflare checks.
|
|
230
245
|
<br>[Install](https://docs.chatgptautorefresh.com/#-installation) /
|
|
231
246
|
[Readme](https://docs.chatgptautorefresh.com/#readme) /
|
|
232
247
|
[Discuss](https://github.chatgptautorefresh.com/discussions)
|
|
233
248
|
|
|
234
|
-
### <img src="https://media.ddgpt.com/images/icons/duckduckgpt/icon48.png"
|
|
249
|
+
### <img width=23 src="https://media.ddgpt.com/images/icons/duckduckgpt/icon48.png?af89302"> [DuckDuckGPT](https://duckduckgpt.com) <a href="https://www.producthunt.com/posts/duckduckgpt?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-duckduckgpt" target="_blank" rel="noopener"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=379261&theme=light" style="width: 112px; height: 24px; margin:0 0 -4px 5px;" width="112" height="24" /></a>
|
|
235
250
|
|
|
236
|
-
>
|
|
251
|
+
> Adds AI answers to DuckDuckGo (powered by GPT-4o!)
|
|
237
252
|
<br>[Install](https://docs.ddgpt.com/#-installation) /
|
|
238
253
|
[Readme](https://docs.ddgpt.com/#readme) /
|
|
239
254
|
[Discuss](https://github.ddgpt.com/discussions)
|
|
240
255
|
|
|
241
|
-
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.googlegpt.io/images/icons/googlegpt/white/icon32.png"><img width=
|
|
256
|
+
### <picture><source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://media.googlegpt.io/images/icons/googlegpt/white/icon32.png?8652a6e"><img width=21 src="https://media.googlegpt.io/images/icons/googlegpt/black/icon32.png?8652a6e"></picture> [GoogleGPT](https://googlegpt.io) <a href="https://github.com/awesome-scripts/awesome-userscripts#chatgpt" target="_blank" rel="noopener"><img src="https://media.googlegpt.io/images/badges/awesome/badge.svg?699c63d" style="margin:0 0 -2px 5px"></a>
|
|
242
257
|
|
|
243
|
-
>
|
|
244
|
-
<br>[Install](https://greasyfork.
|
|
258
|
+
> Adds AI answers to Google Search (powered by Google Gemma + GPT-4o!)
|
|
259
|
+
<br>[Install](https://greasyfork.googlegpt.io) /
|
|
245
260
|
[Readme](https://docs.googlegpt.io/#readme) /
|
|
246
261
|
[Discuss](https://github.googlegpt.io/discussions)
|
|
247
262
|
|
|
263
|
+
### <img width=23 src="https://media.chatgptjs.org/images/icons/platforms/thunderbird/icon32.png?313a9c5"> [ThunderAI](https://micz.it/thunderdbird-addon-thunderai/) <a href="https://addons.thunderbird.net/thunderbird/addon/thunderai/reviews"><picture><source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://media.chatgptjs.org/images/badges/5-star/blue-stars.png?0943672"><img width=92 alt="[Rated 5-stars]" src="https://media.chatgptjs.org/images/badges/5-star/yellow-stars-in-white-pill.png?0943672"></picture></a>
|
|
264
|
+
|
|
265
|
+
> Use ChatGPT in Thunderbird to enhance you emails, even with a free account!
|
|
266
|
+
<br>[Install](https://addons.thunderbird.net/thunderbird/addon/thunderai/) /
|
|
267
|
+
[Readme](https://micz.it/thunderdbird-addon-thunderai/) /
|
|
268
|
+
[Support](https://github.com/micz/ThunderAI/issues)
|
|
269
|
+
|
|
248
270
|
<p><br>
|
|
249
271
|
|
|
250
272
|
<a href="https://chatgptinfinity.com" target="_blank" rel="noopener">
|
|
251
|
-
<img width=555 src="https://
|
|
273
|
+
<img width=555 src="https://cdn.jsdelivr.net/gh/adamlui/chatgpt-infinity@0f48c4e/chrome/media/images/tiles/marquee-promo-tile-1400x560.png">
|
|
252
274
|
</a>
|
|
253
275
|
|
|
254
276
|
<p><br>
|
|
255
277
|
|
|
256
278
|
<a href="https://chatgptwidescreen.com" target="_blank" rel="noopener">
|
|
257
|
-
<img width=555 src="https://
|
|
279
|
+
<img width=555 src="https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@3ed0950/chrome/media/images/tiles/marquee-promo-tile-1400x560.png">
|
|
258
280
|
</a>
|
|
259
281
|
|
|
260
282
|
<p><br>
|
|
@@ -275,36 +297,37 @@ This library exists thanks to code, translations, issues & ideas from the follow
|
|
|
275
297
|
|
|
276
298
|
<div align="center"><br>
|
|
277
299
|
|
|
278
|
-
[](https://github.com/adamlui)
|
|
301
|
+
[](https://github.com/mefengl)
|
|
302
|
+
[](https://github.com/Zin6969)
|
|
303
|
+
[](https://github.com/madruga8)
|
|
304
|
+
[](https://github.com/XiaoYingYo)
|
|
305
|
+
[](https://github.com/AliAlSarre)
|
|
306
|
+
[](https://github.com/madkarmaa)
|
|
307
|
+
[](https://github.com/wamoyo)
|
|
308
|
+
[](https://github.com/meiraleal)
|
|
309
|
+
[](https://github.com/eltociear)
|
|
310
|
+
[](https://github.com/Rojojun)
|
|
311
|
+
[](https://github.com/iamnishantgaharwar)
|
|
312
|
+
[](https://github.com/hakimel)
|
|
313
|
+
[](https://github.com/omahs)
|
|
314
|
+
[](https://www.linkedin.com/in/najam-ul-arfeen-khan/)
|
|
315
|
+
[](https://github.com/iambijayd)
|
|
316
|
+
[](https://github.com/abhinavm24)
|
|
317
|
+
[](https://github.com/deyvisml)
|
|
318
|
+
[](https://github.com/philly88r)
|
|
319
|
+
[](https://github.com/thomasgauthier)
|
|
320
|
+
[](https://github.com/pranav-bhatt)
|
|
321
|
+
[](https://github.com/hopana)
|
|
322
|
+
[](https://github.com/emtry)
|
|
323
|
+
[](https://github.com/thedayofcondor)
|
|
324
|
+
[](https://github.com/Luwa-Tech)
|
|
325
|
+
[](https://github.com/micz)
|
|
326
|
+
[](https://github.com/imranaalam)
|
|
327
|
+
[](https://github.com/grayfallstown)
|
|
328
|
+
[](https://github.com/dependabot)
|
|
329
|
+
<a href="https://chatgpt.com"><picture><source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://images.weserv.nl/?url=https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@main/media/images/icons/platforms/chatgpt/black-on-white/icon189.png?h=46&w=46&mask=circle&maxage=7d"><img src="https://images.weserv.nl/?url=https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@main/media/images/icons/platforms/chatgpt/white-on-black/icon189.png?h=46&w=46&mask=circle&maxage=7d" title="ChatGPT"></picture></a>
|
|
330
|
+
<a href="https://poe.com"><picture><source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://images.weserv.nl/?url=https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@main/media/images/icons/platforms/poe/w-purple-blue-stripes/black-on-white/icon175.png?h=46&w=46&mask=circle&maxage=7d"><img src="https://images.weserv.nl/?url=https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@main/media/images/icons/platforms/poe/w-purple-blue-stripes/white-on-black/icon175.png?h=46&w=46&mask=circle&maxage=7d" title="Poe"></picture></a>
|
|
308
331
|
[](https://github.com/ImgBotApp)
|
|
309
332
|
|
|
310
333
|
</div><br>
|
|
@@ -335,7 +358,7 @@ This library exists thanks to code, translations, issues & ideas from the follow
|
|
|
335
358
|
<div align="center">
|
|
336
359
|
|
|
337
360
|
**[Releases](https://github.com/KudoAI/chatgpt.js/releases)** /
|
|
338
|
-
[Userguide](https://github.com/KudoAI/chatgpt.js/blob/
|
|
361
|
+
[Userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.0.0/docs/USERGUIDE.md) /
|
|
339
362
|
[Discuss](https://github.com/KudoAI/chatgpt.js/discussions) /
|
|
340
363
|
<a href="#--------------------------------------------------------------------------------english---------简体中文---------繁體中文---------日本---------한국인---------हिंदी---------नेपाली---------deutsch---------español---------français---------italiano---------nederlands---------português---------việt----">Back to top ↑</a>
|
|
341
364
|
|
package/docs/USERGUIDE.md
CHANGED
|
@@ -23,11 +23,8 @@
|
|
|
23
23
|
- [generateRandomIP](#generaterandomip)
|
|
24
24
|
- [get](#get)
|
|
25
25
|
- [getUserLanguage](#getuserlanguage)
|
|
26
|
-
- [isChromium](#ischromium)
|
|
27
|
-
- [isFirefox](#isfirefox)
|
|
28
26
|
- [isFullScreen](#isfullscreen)
|
|
29
27
|
- [isLoaded `async`](#isloaded-async)
|
|
30
|
-
- [isMobileDevice](#ismobiledevice)
|
|
31
28
|
- [printAllFunctions](#printallfunctions)
|
|
32
29
|
- [randomFloat](#randomfloat)
|
|
33
30
|
- [renderHTML](#renderhtml)
|
|
@@ -71,6 +68,7 @@
|
|
|
71
68
|
- [startNewChat](#startnewchat)
|
|
72
69
|
- [stop](#stop)
|
|
73
70
|
- [DOM related](#dom-related)
|
|
71
|
+
- [focusChatbar](#focuschatbar)
|
|
74
72
|
- [getChatBox](#getchatbox)
|
|
75
73
|
- [getContinueGeneratingButton](#getcontinuegeneratingbutton)
|
|
76
74
|
- [getFooterDiv](#getfooterdiv)
|
|
@@ -93,14 +91,18 @@
|
|
|
93
91
|
- [browser `api`](#browser-api)
|
|
94
92
|
- [isLightMode](#islightmode-1)
|
|
95
93
|
- [isDarkMode](#isdarkmode-1)
|
|
96
|
-
- [isChromium](#ischromium
|
|
97
|
-
- [
|
|
94
|
+
- [isChromium](#ischromium)
|
|
95
|
+
- [isChrome](#ischrome)
|
|
96
|
+
- [isEdge](#isedge)
|
|
97
|
+
- [isBrave](#isbrave)
|
|
98
|
+
- [isFirefox](#isfirefox)
|
|
98
99
|
- [isFullScreen](#isfullscreen-1)
|
|
99
100
|
- [isMobile](#ismobile)
|
|
100
101
|
- [code `api`](#code-api)
|
|
101
102
|
- [minify `async`](#minify-async)
|
|
102
103
|
- [execute `async`](#execute-async)
|
|
103
104
|
- [extract](#extract)
|
|
105
|
+
- [isIdle `async`](#isidle-async-1)
|
|
104
106
|
- [obfuscate `async`](#obfuscate-async)
|
|
105
107
|
- [refactor `async`](#refactor-async)
|
|
106
108
|
- [review `async`](#review-async)
|
|
@@ -148,7 +150,7 @@
|
|
|
148
150
|
|
|
149
151
|
```js
|
|
150
152
|
(async () => {
|
|
151
|
-
await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@
|
|
153
|
+
await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.0/dist/chatgpt.min.js');
|
|
152
154
|
// Your code here...
|
|
153
155
|
})();
|
|
154
156
|
```
|
|
@@ -157,7 +159,7 @@
|
|
|
157
159
|
|
|
158
160
|
```js
|
|
159
161
|
var xhr = new XMLHttpRequest();
|
|
160
|
-
xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@
|
|
162
|
+
xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.0/dist/chatgpt.min.js');
|
|
161
163
|
xhr.onload = function () {
|
|
162
164
|
if (xhr.status === 200) {
|
|
163
165
|
var chatgptJS = document.createElement('script');
|
|
@@ -179,7 +181,7 @@ function yourCode() {
|
|
|
179
181
|
|
|
180
182
|
```js
|
|
181
183
|
...
|
|
182
|
-
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@
|
|
184
|
+
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.0/dist/chatgpt.min.js
|
|
183
185
|
// ==/UserScript==
|
|
184
186
|
|
|
185
187
|
// Your code here...
|
|
@@ -288,30 +290,6 @@ const userLanguage = chatgpt.getUserLanguage();
|
|
|
288
290
|
console.log(userLanguage); // Example output: 'en-US'
|
|
289
291
|
```
|
|
290
292
|
|
|
291
|
-
### isChromium
|
|
292
|
-
|
|
293
|
-
Returns a boolean value. `true` if the browser is Chromium and `false` otherwise.
|
|
294
|
-
|
|
295
|
-
Example code:
|
|
296
|
-
|
|
297
|
-
```js
|
|
298
|
-
if (chatgpt.isChromium()) {
|
|
299
|
-
// Do something
|
|
300
|
-
}
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
### isFirefox
|
|
304
|
-
|
|
305
|
-
Returns a boolean value. `true` if the browser is Firefox and `false` otherwise.
|
|
306
|
-
|
|
307
|
-
Example code:
|
|
308
|
-
|
|
309
|
-
```js
|
|
310
|
-
if (chatgpt.isFirefox()) {
|
|
311
|
-
// Do something
|
|
312
|
-
}
|
|
313
|
-
```
|
|
314
|
-
|
|
315
293
|
### isFullScreen
|
|
316
294
|
|
|
317
295
|
Returns a boolean value. `true` if the website is fullscreen and `false` otherwise.
|
|
@@ -337,18 +315,6 @@ Example code:
|
|
|
337
315
|
})();
|
|
338
316
|
```
|
|
339
317
|
|
|
340
|
-
### isMobileDevice
|
|
341
|
-
|
|
342
|
-
Returns a boolean value. `true` if the user device is mobile and `false` otherwise.
|
|
343
|
-
|
|
344
|
-
Example code:
|
|
345
|
-
|
|
346
|
-
```js
|
|
347
|
-
if (chatgpt.isMobileDevice()) {
|
|
348
|
-
// Do something
|
|
349
|
-
}
|
|
350
|
-
```
|
|
351
|
-
|
|
352
318
|
### printAllFunctions
|
|
353
319
|
|
|
354
320
|
Prints all the library functions to the console.
|
|
@@ -668,11 +634,13 @@ Example code:
|
|
|
668
634
|
|
|
669
635
|
### clearChats `async`
|
|
670
636
|
|
|
671
|
-
|
|
637
|
+
Clears chat history.
|
|
672
638
|
|
|
673
|
-
|
|
639
|
+
Example code:
|
|
674
640
|
|
|
675
|
-
|
|
641
|
+
```js
|
|
642
|
+
chatgpt.clearChats().then(() => console.log('Chat history cleared!'));
|
|
643
|
+
```
|
|
676
644
|
|
|
677
645
|
### exportChat `async`
|
|
678
646
|
|
|
@@ -933,15 +901,14 @@ console.log(fifthResp); // Example output: 'Hello from ChatGPT!'
|
|
|
933
901
|
|
|
934
902
|
### isIdle `async`
|
|
935
903
|
|
|
936
|
-
|
|
904
|
+
Resolves a promise when ChatGPT has finished generating a response.
|
|
937
905
|
|
|
938
906
|
Example code:
|
|
939
907
|
|
|
940
908
|
```js
|
|
941
909
|
(async () => {
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
}
|
|
910
|
+
await chatgpt.code.isIdle();
|
|
911
|
+
console.log('ChatGPT is idle');
|
|
945
912
|
})();
|
|
946
913
|
```
|
|
947
914
|
|
|
@@ -1070,6 +1037,16 @@ chatgpt.stop();
|
|
|
1070
1037
|
|
|
1071
1038
|
## DOM related
|
|
1072
1039
|
|
|
1040
|
+
### focusChatbar
|
|
1041
|
+
|
|
1042
|
+
Focuses the chatbar.
|
|
1043
|
+
|
|
1044
|
+
Example code:
|
|
1045
|
+
|
|
1046
|
+
```js
|
|
1047
|
+
chatgpt.focusChatbar();
|
|
1048
|
+
```
|
|
1049
|
+
|
|
1073
1050
|
### getChatBox
|
|
1074
1051
|
|
|
1075
1052
|
Returns the chat input as an HTML element.
|
|
@@ -1122,7 +1099,7 @@ Example code:
|
|
|
1122
1099
|
|
|
1123
1100
|
```js
|
|
1124
1101
|
const newChatBtn = chatgpt.getNewChatButton();
|
|
1125
|
-
newChatBtn.
|
|
1102
|
+
newChatBtn.style.display = 'none'; // hide New Chat button
|
|
1126
1103
|
```
|
|
1127
1104
|
|
|
1128
1105
|
### getNewChatLink
|
|
@@ -1133,7 +1110,7 @@ Example code:
|
|
|
1133
1110
|
|
|
1134
1111
|
```js
|
|
1135
1112
|
const newChatLink = chatgpt.getNewChatLink();
|
|
1136
|
-
newChatLink.
|
|
1113
|
+
newChatLink.style.display = 'none'; // hide New Chat link
|
|
1137
1114
|
```
|
|
1138
1115
|
|
|
1139
1116
|
### getRegenerateButton
|
|
@@ -1295,6 +1272,42 @@ if (chatgpt.browser.isChromium()) {
|
|
|
1295
1272
|
}
|
|
1296
1273
|
```
|
|
1297
1274
|
|
|
1275
|
+
### isChrome
|
|
1276
|
+
|
|
1277
|
+
Returns a boolean value. `true` if the browser is Chrome and `false` otherwise.
|
|
1278
|
+
|
|
1279
|
+
Example code:
|
|
1280
|
+
|
|
1281
|
+
```js
|
|
1282
|
+
if (chatgpt.browser.isChrome()) {
|
|
1283
|
+
// Do something
|
|
1284
|
+
}
|
|
1285
|
+
```
|
|
1286
|
+
|
|
1287
|
+
### isEdge
|
|
1288
|
+
|
|
1289
|
+
Returns a boolean value. `true` if the browser is Edge and `false` otherwise.
|
|
1290
|
+
|
|
1291
|
+
Example code:
|
|
1292
|
+
|
|
1293
|
+
```js
|
|
1294
|
+
if (chatgpt.browser.isEdge()) {
|
|
1295
|
+
// Do something
|
|
1296
|
+
}
|
|
1297
|
+
```
|
|
1298
|
+
|
|
1299
|
+
### isBrave
|
|
1300
|
+
|
|
1301
|
+
Returns a boolean value. `true` if the browser is Brave and `false` otherwise.
|
|
1302
|
+
|
|
1303
|
+
Example code:
|
|
1304
|
+
|
|
1305
|
+
```js
|
|
1306
|
+
if (chatgpt.browser.isBrave()) {
|
|
1307
|
+
// Do something
|
|
1308
|
+
}
|
|
1309
|
+
```
|
|
1310
|
+
|
|
1298
1311
|
### isFirefox
|
|
1299
1312
|
|
|
1300
1313
|
Returns a boolean value. `true` if the browser is Firefox and `false` otherwise.
|
|
@@ -1414,6 +1427,20 @@ Example code:
|
|
|
1414
1427
|
})();
|
|
1415
1428
|
```
|
|
1416
1429
|
|
|
1430
|
+
### isIdle `async`
|
|
1431
|
+
|
|
1432
|
+
Resolves a promise when code has finished generating.
|
|
1433
|
+
|
|
1434
|
+
Example code:
|
|
1435
|
+
|
|
1436
|
+
```js
|
|
1437
|
+
(async () => {
|
|
1438
|
+
chatgpt.send('Type me a short code block');
|
|
1439
|
+
await chatgpt.code.isIdle();
|
|
1440
|
+
console.log('Code finished generating'); // non-code may still be generating
|
|
1441
|
+
})();
|
|
1442
|
+
```
|
|
1443
|
+
|
|
1417
1444
|
### obfuscate `async`
|
|
1418
1445
|
|
|
1419
1446
|
Asks ChatGPT to obfuscate the given code.
|
|
@@ -1854,7 +1881,7 @@ chatgpt.sidebar.toggle();
|
|
|
1854
1881
|
|
|
1855
1882
|
### isLoaded `async`
|
|
1856
1883
|
|
|
1857
|
-
Resolves a promise when the ChatGPT sidebar has finished loading.
|
|
1884
|
+
Resolves a promise when the ChatGPT sidebar has finished loading. (Times out 5s after New Chat button loads, since New Chat link does not always appear.)
|
|
1858
1885
|
|
|
1859
1886
|
Example code:
|
|
1860
1887
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kudoai/chatgpt.js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Client-side JavaScript library for ChatGPT",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "KudoAI & contributors",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
26
26
|
"preview:docs": "docsify serve docs",
|
|
27
27
|
"build:js": "bash utils/build.sh",
|
|
28
|
+
"build:docs-js": "minify-js docs --no-mangle",
|
|
28
29
|
"build:css": "scss-to-css",
|
|
29
30
|
"bump:patch": "bash utils/bump.sh patch",
|
|
30
31
|
"bump:minor": "bash utils/bump.sh minor",
|
|
@@ -63,11 +64,11 @@
|
|
|
63
64
|
"url": "https://github.com/sponsors/KudoAI"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
|
-
"@adamlui/minify.js": "^1.
|
|
67
|
-
"@adamlui/scss-to-css": "^1.10.
|
|
67
|
+
"@adamlui/minify.js": "^1.8.1",
|
|
68
|
+
"@adamlui/scss-to-css": "^1.10.3",
|
|
68
69
|
"docsify-cli": "^4.4.4",
|
|
69
|
-
"eslint": "^9.
|
|
70
|
-
"eslint-plugin-json
|
|
71
|
-
"husky": "^9.0
|
|
70
|
+
"eslint": "^9.5.0",
|
|
71
|
+
"eslint-plugin-json": "^4.0.0",
|
|
72
|
+
"husky": "^9.1.0"
|
|
72
73
|
}
|
|
73
74
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<h6>
|
|
3
3
|
<picture>
|
|
4
|
-
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://media.chatgptjs.org/images/icons/earth-americas-white-icon32.svg">
|
|
5
|
-
<img height=14 src="https://media.chatgptjs.org/images/icons/earth-americas-icon32.svg">
|
|
4
|
+
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://media.chatgptjs.org/images/icons/earth-americas-white-icon32.svg?main">
|
|
5
|
+
<img height=14 src="https://media.chatgptjs.org/images/icons/earth-americas-icon32.svg?main">
|
|
6
6
|
</picture>
|
|
7
7
|
English |
|
|
8
8
|
<a href="docs/zh-cn/LICENSE.md">简体中文</a> |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<h6>
|
|
3
3
|
<picture>
|
|
4
|
-
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://media.chatgptjs.org/images/icons/earth-americas-white-icon32.svg">
|
|
5
|
-
<img height=14 src="https://media.chatgptjs.org/images/icons/earth-americas-icon32.svg">
|
|
4
|
+
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://media.chatgptjs.org/images/icons/earth-americas-white-icon32.svg?main">
|
|
5
|
+
<img height=14 src="https://media.chatgptjs.org/images/icons/earth-americas-icon32.svg?main">
|
|
6
6
|
</picture>
|
|
7
7
|
English |
|
|
8
8
|
<a href="zh-cn#readme">简体中文</a> |
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
</h6>
|
|
21
21
|
</div>
|
|
22
22
|
|
|
23
|
-
# <img height=21 src="https://
|
|
23
|
+
# <img height=21 src="https://media.chatgptjs.org/images/icons/platforms/chrome/icon32.png?8c852fa5"> chatgpt.js-chrome-starter
|
|
24
24
|
|
|
25
25
|
<h3>A starting point for developing your own Chrome extension using <a href="https://github.com/KudoAI/chatgpt.js">chatgpt.js</a></h3>
|
|
26
26
|
|
|
@@ -77,13 +77,13 @@ These are some of the extensions featured by Google that use chatgpt.js:
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
<a href="https://chatgptinfinity.com" target="_blank" rel="noopener">
|
|
80
|
-
<img width=777 src="https://
|
|
80
|
+
<img width=777 src="https://cdn.jsdelivr.net/gh/adamlui/chatgpt-infinity@0f48c4e/chrome/media/images/tiles/marquee-promo-tile-1400x560.png">
|
|
81
81
|
</a>
|
|
82
82
|
|
|
83
83
|
<p><br>
|
|
84
84
|
|
|
85
85
|
<a href="https://chatgptwidescreen.com" target="_blank" rel="noopener">
|
|
86
|
-
<img width=777 src="https://
|
|
86
|
+
<img width=777 src="https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@3ed0950/chrome/media/images/tiles/marquee-promo-tile-1400x560.png">
|
|
87
87
|
</a>
|
|
88
88
|
|
|
89
89
|
</div>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<div align="right">
|
|
2
2
|
<h6>
|
|
3
3
|
<picture>
|
|
4
|
-
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://media.chatgptjs.org/images/icons/earth-americas-white-icon32.svg">
|
|
5
|
-
<img height=14 src="https://media.chatgptjs.org/images/icons/earth-americas-icon32.svg">
|
|
4
|
+
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://media.chatgptjs.org/images/icons/earth-americas-white-icon32.svg?main">
|
|
5
|
+
<img height=14 src="https://media.chatgptjs.org/images/icons/earth-americas-icon32.svg?main">
|
|
6
6
|
</picture>
|
|
7
7
|
English |
|
|
8
8
|
<a href="https://github.com/KudoAI/chatgpt.js-chrome-starter/blob/main/docs/zh-cn/SECURITY.md">简体中文</a> |
|