@kudoai/chatgpt.js 2.6.4 → 2.6.6
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 +341 -0
- package/chatgpt.js +22 -22
- package/dist/chatgpt.min.js +7 -0
- package/docs/README.md +341 -324
- package/docs/USERGUIDE.md +1812 -1814
- package/docs/de/README.md +341 -324
- package/docs/es/README.md +341 -324
- package/docs/fr/README.md +341 -324
- package/docs/hi/README.md +342 -325
- package/docs/it/README.md +341 -324
- package/docs/ja/README.md +341 -324
- package/docs/ko/README.md +346 -329
- package/docs/ne/README.md +342 -325
- package/docs/nl/README.md +341 -324
- package/docs/pt/README.md +341 -324
- package/docs/vi/README.md +341 -324
- package/docs/zh-cn/README.md +341 -324
- package/docs/zh-tw/README.md +340 -323
- package/package.json +51 -31
- package/starters/chrome/LICENSE.md +43 -0
- package/starters/chrome/docs/README.md +17 -1
- package/starters/chrome/docs/SECURITY.md +17 -0
- package/starters/chrome/docs/de/LICENSE.md +21 -3
- package/starters/chrome/docs/de/README.md +17 -1
- package/starters/chrome/docs/es/LICENSE.md +21 -3
- package/starters/chrome/docs/es/README.md +17 -1
- package/starters/chrome/docs/fr/LICENSE.md +21 -3
- package/starters/chrome/docs/fr/README.md +17 -1
- package/starters/chrome/docs/hi/LICENSE.md +21 -3
- package/starters/chrome/docs/hi/README.md +17 -2
- package/starters/chrome/docs/hi/SECURITY.md +17 -0
- package/starters/chrome/docs/it/LICENSE.md +21 -3
- package/starters/chrome/docs/it/README.md +17 -1
- package/starters/chrome/docs/ja/LICENSE.md +21 -3
- package/starters/chrome/docs/ja/README.md +17 -2
- package/starters/chrome/docs/ko/LICENSE.md +21 -3
- package/starters/chrome/docs/ko/README.md +17 -1
- package/starters/chrome/docs/nl/LICENSE.md +20 -3
- package/starters/chrome/docs/nl/README.md +17 -1
- package/starters/chrome/docs/pt/LICENSE.md +21 -3
- package/starters/chrome/docs/pt/README.md +17 -1
- package/starters/chrome/docs/vi/LICENSE.md +21 -3
- package/starters/chrome/docs/vi/README.md +17 -1
- package/starters/chrome/docs/zh-cn/LICENSE.md +21 -3
- package/starters/chrome/docs/zh-cn/README.md +17 -2
- package/starters/chrome/docs/zh-cn/SECURITY.md +17 -0
- package/starters/chrome/docs/zh-tw/LICENSE.md +21 -3
- package/starters/chrome/docs/zh-tw/README.md +17 -1
- package/starters/chrome/extension/content.js +1 -1
- package/starters/chrome/extension/lib/chatgpt.js +6 -4
- package/starters/chrome/extension/manifest.json +1 -1
- package/starters/greasemonkey/LICENSE.md +43 -0
- package/starters/greasemonkey/chatgpt.js-greasemonkey-starter.user.js +52 -52
- package/starters/greasemonkey/docs/SECURITY.md +17 -0
- package/starters/greasemonkey/docs/de/LICENSE.md +31 -0
- package/starters/greasemonkey/docs/es/LICENSE.md +31 -0
- package/starters/greasemonkey/docs/fr/LICENSE.md +31 -0
- package/starters/greasemonkey/docs/hi/LICENSE.md +31 -0
- package/starters/greasemonkey/docs/hi/SECURITY.md +17 -0
- package/starters/greasemonkey/docs/it/LICENSE.md +29 -0
- package/starters/greasemonkey/docs/ja/LICENSE.md +31 -0
- package/starters/greasemonkey/docs/ko/LICENSE.md +34 -0
- package/starters/greasemonkey/docs/nl/LICENSE.md +30 -0
- package/starters/greasemonkey/docs/pt/LICENSE.md +31 -0
- package/starters/greasemonkey/docs/vi/LICENSE.md +31 -0
- package/starters/greasemonkey/docs/zh-cn/LICENSE.md +31 -0
- package/starters/greasemonkey/docs/zh-cn/SECURITY.md +17 -0
- package/starters/greasemonkey/docs/zh-tw/LICENSE.md +31 -0
- package/dist/chatgpt-2.6.4.min.js +0 -1
- package/docs/.nojekyll +0 -0
- package/docs/CNAME +0 -1
- package/docs/_coverpage.md +0 -16
- package/docs/_utils/LICENSE.md +0 -21
- package/docs/_utils/minify.js +0 -50
- package/docs/assets/docsify/cursors/futuristic/pointer.cur +0 -0
- package/docs/assets/docsify/favicons/favicon16.png +0 -0
- package/docs/assets/docsify/favicons/favicon320.png +0 -0
- package/docs/assets/docsify/favicons/favicon48.png +0 -0
- package/docs/assets/docsify/favicons/favicon64.png +0 -0
- package/docs/assets/docsify/fonts/eurostile-extended-black/EurostileExtendedBlack.otf +0 -0
- package/docs/assets/docsify/fonts/eurostile-extended-black/EurostileExtendedBlack.ttf +0 -0
- package/docs/assets/docsify/fonts/eurostile-extended-black/EurostileExtendedBlack.woff +0 -0
- package/docs/assets/docsify/fonts/eurostile-extended-black/EurostileExtendedBlack.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/OFL.txt +0 -93
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-Bold.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-BoldItalic.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-ExtraLight.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-ExtraLightItalic.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-Italic.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-Light.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-LightItalic.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-Medium.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-MediumItalic.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-Regular.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-SemiBold.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-SemiBoldItalic.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-Thin.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/otf/IBMPlexMono-ThinItalic.otf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-Bold.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-BoldItalic.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-ExtraLight.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-ExtraLightItalic.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-Italic.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-Light.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-LightItalic.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-Medium.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-MediumItalic.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-Regular.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-SemiBold.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-SemiBoldItalic.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-Thin.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/ttf/IBMPlexMono-ThinItalic.ttf +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-Bold.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-BoldItalic.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-ExtraLight.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-ExtraLightItalic.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-Italic.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-Light.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-LightItalic.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-Medium.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-MediumItalic.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-Regular.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-SemiBold.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-SemiBoldItalic.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-Thin.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff/IBMPlexMono-ThinItalic.woff +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-Bold.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-BoldItalic.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-ExtraLight.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-ExtraLightItalic.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-Italic.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-Light.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-LightItatlic.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-Medium.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-MediumItalic.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-Regular.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-SemiBold.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-SemiBoldItalic.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-Thin.woff2 +0 -0
- package/docs/assets/docsify/fonts/ibm-plex-mono/woff2/IBMPlexMono-ThinItalic.woff2 +0 -0
- package/docs/assets/docsify/fonts/major-mono-display/MajorMonoDisplay-Regular.otf +0 -0
- package/docs/assets/docsify/fonts/major-mono-display/MajorMonoDisplay-Regular.ttf +0 -0
- package/docs/assets/docsify/fonts/major-mono-display/MajorMonoDisplay-Regular.woff +0 -0
- package/docs/assets/docsify/fonts/major-mono-display/MajorMonoDisplay-Regular.woff2 +0 -0
- package/docs/assets/docsify/fonts/major-mono-display/OFL.txt +0 -93
- package/docs/assets/docsify/fonts/polysans-neutral/PolySansNeutral.eot +0 -0
- package/docs/assets/docsify/fonts/polysans-neutral/PolySansNeutral.ttf +0 -0
- package/docs/assets/docsify/fonts/polysans-neutral/PolySansNeutral.woff +0 -0
- package/docs/assets/docsify/fonts/polysans-neutral/PolySansNeutral.woff2 +0 -0
- package/docs/assets/docsify/html/footer.html +0 -23
- package/docs/assets/docsify/js/min/back-to-top-button.min.js +0 -1
- package/docs/assets/docsify/js/min/copy-code-button.min.js +0 -1
- package/docs/assets/docsify/js/min/onload-hacks.min.js +0 -3
- package/docs/assets/docsify/js/min/starry-background.min.js +0 -1
- package/docs/assets/docsify/js/src/back-to-top-button.js +0 -64
- package/docs/assets/docsify/js/src/copy-code-button.js +0 -91
- package/docs/assets/docsify/js/src/onload-hacks.js +0 -613
- package/docs/assets/docsify/js/src/starry-background.js +0 -111
- package/docs/assets/docsify/styles/css/style.min.css +0 -1
- package/docs/assets/docsify/styles/css/style.min.css.map +0 -1
- package/docs/assets/docsify/styles/scss/style.scss +0 -510
- package/docs/assets/separators/aqua.png +0 -0
- package/docs/de/_coverpage.md +0 -12
- package/docs/es/_coverpage.md +0 -12
- package/docs/fr/_coverpage.md +0 -12
- package/docs/hi/_coverpage.md +0 -12
- package/docs/index.html +0 -91
- package/docs/it/_coverpage.md +0 -12
- package/docs/ja/_coverpage.md +0 -12
- package/docs/ko/_coverpage.md +0 -12
- package/docs/ne/_coverpage.md +0 -12
- package/docs/nl/_coverpage.md +0 -12
- package/docs/pt/_coverpage.md +0 -12
- package/docs/vi/_coverpage.md +0 -12
- package/docs/zh-cn/_coverpage.md +0 -12
- package/docs/zh-tw/_coverpage.md +0 -12
- package/starters/chrome/LICENSE +0 -21
- package/starters/greasemonkey/LICENSE +0 -21
package/README.md
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
<div id="repo-cover" align="center">
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<h6>
|
|
5
|
+
<a href="https://github.com/kudoai/chatgpt.js/tree/main/docs">
|
|
6
|
+
<picture>
|
|
7
|
+
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/KudoAI/chatgpt.js/main/media/images/icons/earth-americas-white-padded-icon17x15.svg">
|
|
8
|
+
<img src="https://raw.githubusercontent.com/KudoAI/chatgpt.js/main/media/images/icons/earth-americas-padded-icon17x15.svg">
|
|
9
|
+
</picture>
|
|
10
|
+
</a>
|
|
11
|
+
English |
|
|
12
|
+
<a href="https://github.com/KudoAI/chatgpt.js/tree/main/docs/zh-cn#readme">简体中文</a> |
|
|
13
|
+
<a href="zh-tw#readme">繁體中文</a> |
|
|
14
|
+
<a href="https://github.com/KudoAI/chatgpt.js/tree/main/docs/ja#readme">日本</a> |
|
|
15
|
+
<a href="https://github.com/KudoAI/chatgpt.js/tree/main/docs/ko#readme">한국인</a> |
|
|
16
|
+
<a href="https://github.com/KudoAI/chatgpt.js/tree/main/docs/hi#readme">हिंदी</a> |
|
|
17
|
+
<a href="https://github.com/KudoAI/chatgpt.js/tree/main/docs/np#readme">नेपाली</a> |
|
|
18
|
+
<a href="https://github.com/KudoAI/chatgpt.js/tree/main/docs/de#readme">Deutsch</a> |
|
|
19
|
+
<a href="https://github.com/KudoAI/chatgpt.js/tree/main/docs/es#readme">Español</a> |
|
|
20
|
+
<a href="https://github.com/KudoAI/chatgpt.js/tree/main/docs/fr#readme">Français</a> |
|
|
21
|
+
<a href="https://github.com/KudoAI/chatgpt.js/tree/main/docs/it#readme">Italiano</a> |
|
|
22
|
+
<a href="https://github.com/KudoAI/chatgpt.js/tree/main/docs/nl#readme">Nederlands</a> |
|
|
23
|
+
<a href="https://github.com/KudoAI/chatgpt.js/tree/main/docs/pt#readme">Português</a> |
|
|
24
|
+
<a href="https://github.com/KudoAI/chatgpt.js/tree/main/docs/vi#readme">Việt</a>
|
|
25
|
+
</h6>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<br>
|
|
29
|
+
|
|
30
|
+
<picture>
|
|
31
|
+
<source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/media/images/logos/chatgpt.js/with-reflection/darkmode.png">
|
|
32
|
+
<img width=800 src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/media/images/logos/chatgpt.js/with-reflection/lightmode.png">
|
|
33
|
+
</picture>
|
|
34
|
+
|
|
35
|
+
### 🤖 A powerful client-side JavaScript library for ChatGPT
|
|
36
|
+
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<br>
|
|
40
|
+
|
|
41
|
+
<div id="shields" align="center">
|
|
42
|
+
|
|
43
|
+
[](https://github.com/KudoAI/chatgpt.js/stargazers)
|
|
44
|
+
[](https://github.com/KudoAI/chatgpt.js/blob/main/LICENSE)
|
|
45
|
+
[](https://github.com/kudoai/chatgpt.js/commits/main)
|
|
46
|
+

|
|
47
|
+
[](https://app.codacy.com/gh/KudoAI/chatgpt.js/commits?utm_source=chatgpt%2Ejs&utm_content=github_shield)
|
|
48
|
+
[](https://github.com/sindresorhus/awesome-chatgpt#javascript)
|
|
49
|
+
[](https://www.producthunt.com/posts/chatgpt-js)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<img height=8px width="100%" src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/docs/assets/images/aqua-separator.png">
|
|
55
|
+
|
|
56
|
+
<div id="intro">
|
|
57
|
+
|
|
58
|
+
## 💡 About
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<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.
|
|
63
|
+
|
|
64
|
+
- Feature-rich
|
|
65
|
+
- Object-oriented
|
|
66
|
+
- Easy-to-use
|
|
67
|
+
- Lightweight (yet optimally performant)
|
|
68
|
+
|
|
69
|
+
<img height=8px width="100%" src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/docs/assets/images/aqua-separator.png">
|
|
70
|
+
|
|
71
|
+
<div id="importing">
|
|
72
|
+
|
|
73
|
+
## ⚡ Importing the library
|
|
74
|
+
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
> **Note** _To always import the latest version (NOT recommended in production!) replace the versioned jsDelivr URL with: `https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js/chatgpt.min.js`_
|
|
78
|
+
|
|
79
|
+
### ES6:
|
|
80
|
+
|
|
81
|
+
```js
|
|
82
|
+
(async () => {
|
|
83
|
+
await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@2.6.5/dist/chatgpt.min.js');
|
|
84
|
+
// Your code here...
|
|
85
|
+
})();
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### ES5:
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
var xhr = new XMLHttpRequest();
|
|
92
|
+
xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@2.6.5/dist/chatgpt.min.js');
|
|
93
|
+
xhr.onload = function () {
|
|
94
|
+
if (xhr.status === 200) {
|
|
95
|
+
var chatgptJS = document.createElement('script');
|
|
96
|
+
chatgptJS.textContent = xhr.responseText;
|
|
97
|
+
document.head.append(chatgptJS);
|
|
98
|
+
yourCode(); // runs your code
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
xhr.send();
|
|
102
|
+
|
|
103
|
+
function yourCode() {
|
|
104
|
+
// Your code here...
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### <img style="margin: 0 2px -0.065rem 0" height=17 src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/starters/media/images/icons/tampermonkey-icon28.png"></picture><img style="margin: 0 2px -0.035rem 1px" height=17.5 src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/starters/media/images/icons/violentmonkey-icon100.png"> Greasemonkey:
|
|
109
|
+
|
|
110
|
+
> **Note** _To use a starter template: [kudoai/chatgpt.js-greasemonkey-starter](https://github.com/kudoai/chatgpt.js-greasemonkey-starter)_
|
|
111
|
+
|
|
112
|
+
```js
|
|
113
|
+
...
|
|
114
|
+
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@2.6.5/dist/chatgpt.min.js
|
|
115
|
+
// ==/UserScript==
|
|
116
|
+
|
|
117
|
+
// Your code here...
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### <img style="margin: 0 2px -1px 0" height=16 src="https://www.google.com/chrome/static/images/favicons/apple-icon-60x60.png"> Chrome:
|
|
121
|
+
|
|
122
|
+
> **Note** _To use a starter template: [kudoai/chatgpt.js-chrome-starter](https://github.com/kudoai/chatgpt.js-chrome-starter)_
|
|
123
|
+
|
|
124
|
+
Since Google does not allow remote code, importing chatgpt.js locally is required:
|
|
125
|
+
|
|
126
|
+
1. Save https://raw.githubusercontent.com/kudoai/chatgpt.js/main/chatgpt.js to a subdirectory (`lib` in this example)
|
|
127
|
+
|
|
128
|
+
2. Add ES6 export statement to end of `lib/chatgpt.js`
|
|
129
|
+
```js
|
|
130
|
+
...
|
|
131
|
+
export { chatgpt }
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
3. In project's (V3) `manifest.json`, add `lib/chatgpt.js` as a web accessible resource
|
|
135
|
+
```json
|
|
136
|
+
"web_accessible_resources": [{
|
|
137
|
+
"matches": ["<all_urls>"],
|
|
138
|
+
"resources": ["lib/chatgpt.js"]
|
|
139
|
+
}],
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
4. In scripts that need `chatgpt.js` (foreground/background alike), import it like so:
|
|
143
|
+
```js
|
|
144
|
+
(async () => {
|
|
145
|
+
const { chatgpt } = await import(chrome.runtime.getURL('lib/chatgpt.js'));
|
|
146
|
+
// Your code here...
|
|
147
|
+
})();
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
<img height=8px width="100%" src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/docs/assets/images/aqua-separator.png">
|
|
151
|
+
|
|
152
|
+
<div id="npm">
|
|
153
|
+
|
|
154
|
+
## 💾 Downloading via npm:
|
|
155
|
+
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
To download **chatgpt.js** for local customization, run the following command in your project's root:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
npm install @kudoai/chatgpt.js
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
After installation, navigate to `node_modules/@kudoai/chatgpt.js` to find the library source (minified version in `dist/`).
|
|
165
|
+
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<img height=8px width="100%" src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/docs/assets/images/aqua-separator.png">
|
|
169
|
+
|
|
170
|
+
<div id="usage">
|
|
171
|
+
|
|
172
|
+
## 💻 Usage
|
|
173
|
+
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
**chatgpt.js** was written w/ ultra flexibility in mind.
|
|
177
|
+
|
|
178
|
+
For example:
|
|
179
|
+
|
|
180
|
+
```js
|
|
181
|
+
chatgpt.getLastResponse();
|
|
182
|
+
chatgpt.getLastReply();
|
|
183
|
+
chatgpt.response.getLast();
|
|
184
|
+
chatgpt.get('reply', 'last');
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Each call equally fetches the last response. If you think it works, it probably will... so just type it!
|
|
188
|
+
|
|
189
|
+
If it didn't, check out the extended [userguide](https://github.com/kudoai/chatgpt.js/blob/main/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!
|
|
190
|
+
|
|
191
|
+
<img height=8px width="100%" src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/docs/assets/images/aqua-separator.png">
|
|
192
|
+
|
|
193
|
+
<div id="showcase">
|
|
194
|
+
|
|
195
|
+
## 🤖 Made with chatgpt.js
|
|
196
|
+
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
https://github.com/KudoAI/chatgpt.js/assets/10906554/f53c740f-d5e0-49b6-ae02-3b3140b0f8a4
|
|
200
|
+
|
|
201
|
+
#
|
|
202
|
+
|
|
203
|
+
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://i.imgur.com/RduASbD.png"><img width=16 src="https://raw.githubusercontent.com/adamlui/chatgpt-addons/main/media/icons/openai-favicon64.png"></picture> [Autoclear ChatGPT History](https://autoclearchatgpt.com) <a href="https://github.com/awesome-scripts/awesome-userscripts#chatgpt" target="_blank" rel="noopener"><img src="https://awesome.re/mentioned-badge.svg" style="margin:0 0 -2px 5px"></a>
|
|
204
|
+
|
|
205
|
+
> Auto-clear your ChatGPT query history for maximum privacy.
|
|
206
|
+
<br>[Install](https://github.com/adamlui/autoclear-chatgpt-history#-installation) /
|
|
207
|
+
[Readme](https://github.com/adamlui/autoclear-chatgpt-history#readme) /
|
|
208
|
+
[Discuss](https://autoclearchatgpt.com/discuss)
|
|
209
|
+
|
|
210
|
+
### <img width=16 src="https://i.imgur.com/1yjmK3W.png"> [Automatic ChatGPT DAN](https://github.com/madkarmaa/automatic-chatgpt-dan)
|
|
211
|
+
|
|
212
|
+
> Automatically send DAN prompts to ChatGPT.
|
|
213
|
+
<br>[Install](https://github.com/madkarmaa/automatic-chatgpt-dan#%EF%B8%8F-installation) /
|
|
214
|
+
[Readme](https://github.com/madkarmaa/automatic-chatgpt-dan#readme) /
|
|
215
|
+
[Discuss](https://github.com/madkarmaa/automatic-chatgpt-dan/issues)
|
|
216
|
+
|
|
217
|
+
### <img src="https://media.bravegpt.com/images/icons/bravegpt/icon48.png" width=18> [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>
|
|
218
|
+
|
|
219
|
+
> Display ChatGPT answers in Brave Search sidebar (powered by GPT-4!)
|
|
220
|
+
<br>[Install](https://github.bravegpt.com/#-installation) /
|
|
221
|
+
[Readme](https://github.bravegpt.com/#readme) /
|
|
222
|
+
[Discuss](https://github.bravegpt.com/discussions)
|
|
223
|
+
|
|
224
|
+
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://i.imgur.com/RduASbD.png"><img width=16 src="https://raw.githubusercontent.com/adamlui/chatgpt-userscripts/main/media/icons/openai-favicon64.png"></picture> [ChatGPT Auto-Continue ⏩](https://chatgptautocontinue.com) <a href="https://github.com/awesome-scripts/awesome-userscripts#chatgpt" target="_blank" rel="noopener"><img src="https://awesome.re/mentioned-badge.svg" style="margin:0 0 -3px 3px"></a>
|
|
225
|
+
|
|
226
|
+
> Automatically continue generating multiple ChatGPT responses.
|
|
227
|
+
<br>[Install](https://github.com/adamlui/chatgpt-auto-continue#-installation) /
|
|
228
|
+
[Readme](https://github.com/adamlui/chatgpt-auto-continue#readme) /
|
|
229
|
+
[Discuss](https://chatgptautocontinue.com/discuss)
|
|
230
|
+
|
|
231
|
+
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://i.imgur.com/RduASbD.png"><img width=16 src="https://raw.githubusercontent.com/adamlui/chatgpt-addons/main/media/icons/openai-favicon64.png"></picture> [ChatGPT Auto Refresh ↻](https://chatgptautorefresh.com) <a href="https://github.com/awesome-scripts/awesome-userscripts#chatgpt" target="_blank" rel="noopener"><img src="https://awesome.re/mentioned-badge.svg" style="margin:0 0 -2px 5px"></a>
|
|
232
|
+
|
|
233
|
+
> Keeps ChatGPT sessions fresh to eliminate network errors + Cloudflare checks.
|
|
234
|
+
<br>[Install](https://github.com/adamlui/chatgpt-auto-refresh#-installation) /
|
|
235
|
+
[Readme](https://github.com/adamlui/chatgpt-auto-refresh#readme) /
|
|
236
|
+
[Discuss](https://chatgptautorefresh.com/discuss)
|
|
237
|
+
|
|
238
|
+
### <img src="https://media.ddgpt.com/images/icons/duckduckgpt/icon48.png" width=17> [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>
|
|
239
|
+
|
|
240
|
+
> Display ChatGPT answers in DuckDuckGo sidebar (powered by GPT-4!)
|
|
241
|
+
<br>[Install](https://github.duckduckgpt.com/#-installation) /
|
|
242
|
+
[Readme](https://github.duckduckgpt.com/#readme) /
|
|
243
|
+
[Discuss](https://github.duckduckgpt.com/discussions)
|
|
244
|
+
|
|
245
|
+
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.googlegpt.io/images/icons/googlegpt/white/icon32.png"><img width=17 src="https://media.googlegpt.io/images/icons/googlegpt/black/icon32.png"></picture> [GoogleGPT](https://googlegpt.kudoai.com)
|
|
246
|
+
|
|
247
|
+
> Display ChatGPT answers in Google Search sidebar (powered by GPT-4!)
|
|
248
|
+
<br>[Install](https://greasyfork.org/scripts/478597-googlegpt) /
|
|
249
|
+
[Readme](https://github.com/KudoAI/googlegpt#readme) /
|
|
250
|
+
[Discuss](https://github.com/KudoAI/googlegpt/discussions)
|
|
251
|
+
|
|
252
|
+
<p><br>
|
|
253
|
+
|
|
254
|
+
<a href="https://chatgptinfinity.com" target="_blank" rel="noopener">
|
|
255
|
+
<img width=555 src="https://raw.githubusercontent.com/adamlui/chatgpt-infinity/main/chrome/media/images/tiles/marquee-promo-tile-1400x560.png">
|
|
256
|
+
</a>
|
|
257
|
+
|
|
258
|
+
<p><br>
|
|
259
|
+
|
|
260
|
+
<a href="https://chatgptwidescreen.com" target="_blank" rel="noopener">
|
|
261
|
+
<img width=555 src="https://raw.githubusercontent.com/adamlui/chatgpt-widescreen/main/chrome/media/images/tiles/marquee-promo-tile-1400x560.png">
|
|
262
|
+
</a>
|
|
263
|
+
|
|
264
|
+
<p><br>
|
|
265
|
+
|
|
266
|
+
<p id="showcase-cta">
|
|
267
|
+
If you've made something w/ chatgpt.js you want to share, email <a href="mailto:showcase@chatgptjs.org">showcase@chatgptjs.org</a> or just open a <a href="https://github.com/kudoai/chatgpt.js/pulls" target="_blank" rel="noopener">pull request</a>!
|
|
268
|
+
</p>
|
|
269
|
+
|
|
270
|
+
<img height=8px width="100%" src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/docs/assets/images/aqua-separator.png">
|
|
271
|
+
|
|
272
|
+
<div id="contributors">
|
|
273
|
+
|
|
274
|
+
## 🧠 Contributors
|
|
275
|
+
|
|
276
|
+
</div>
|
|
277
|
+
|
|
278
|
+
This library exists thanks to code, translations, issues & ideas from the following contributors:
|
|
279
|
+
|
|
280
|
+
<div align="center"><br>
|
|
281
|
+
|
|
282
|
+
[](https://github.com/adamlui)
|
|
283
|
+
[](https://github.com/mefengl)
|
|
284
|
+
[](https://github.com/Zin6969)
|
|
285
|
+
[](https://github.com/madruga8)
|
|
286
|
+
[](https://github.com/XiaoYingYo)
|
|
287
|
+
[](https://github.com/AliAlSarre)
|
|
288
|
+
[](https://github.com/madkarmaa)
|
|
289
|
+
[](https://github.com/wamoyo)
|
|
290
|
+
[](https://github.com/meiraleal)
|
|
291
|
+
[](https://github.com/eltociear)
|
|
292
|
+
[](https://github.com/Rojojun)
|
|
293
|
+
[](https://github.com/iamnishantgaharwar)
|
|
294
|
+
[](https://github.com/hakimel)
|
|
295
|
+
[](https://github.com/omahs)
|
|
296
|
+
[](https://www.linkedin.com/in/najam-ul-arfeen-khan/)
|
|
297
|
+
[](https://github.com/iambijayd)
|
|
298
|
+
[](https://github.com/abhinavm24)
|
|
299
|
+
[](https://github.com/deyvisml)
|
|
300
|
+
[](https://github.com/philly88r)
|
|
301
|
+
[](https://github.com/thomasgauthier)
|
|
302
|
+
[](https://github.com/pranav-bhatt)
|
|
303
|
+
[](https://github.com/Luwa-Tech)
|
|
304
|
+
[](https://github.com/dependabot)
|
|
305
|
+
[](https://chat.openai.com)
|
|
306
|
+
[](https://poe.com)
|
|
307
|
+
[](https://github.com/ImgBotApp)
|
|
308
|
+
|
|
309
|
+
</div><br>
|
|
310
|
+
|
|
311
|
+
<img height=8px width="100%" src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/docs/assets/images/aqua-separator.png">
|
|
312
|
+
|
|
313
|
+
<div id="partners">
|
|
314
|
+
|
|
315
|
+
## 🤝 Partners
|
|
316
|
+
|
|
317
|
+
</div>
|
|
318
|
+
|
|
319
|
+
**chatgpt.js** is funded in part by:
|
|
320
|
+
|
|
321
|
+
<div id="partners-collage" align="center">
|
|
322
|
+
|
|
323
|
+
<picture>
|
|
324
|
+
<source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/media/images/logos/partners/collage/white.png">
|
|
325
|
+
<img width=888 src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/media/images/logos/partners/collage/black.png">
|
|
326
|
+
</picture>
|
|
327
|
+
|
|
328
|
+
</div>
|
|
329
|
+
|
|
330
|
+
<br>
|
|
331
|
+
|
|
332
|
+
<img height=8px width="100%" src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/docs/assets/images/aqua-separator.png">
|
|
333
|
+
|
|
334
|
+
<div align="center">
|
|
335
|
+
|
|
336
|
+
**[Releases](https://www.npmjs.com/package/@kudoai/chatgpt.js?activeTab=versions)** /
|
|
337
|
+
[Userguide](https://github.com/kudoai/chatgpt.js/blob/main/docs/USERGUIDE.md) /
|
|
338
|
+
[Discuss](https://github.com/kudoai/chatgpt.js/discussions) /
|
|
339
|
+
<a href="#">Back to top ↑</a>
|
|
340
|
+
|
|
341
|
+
</div>
|
package/chatgpt.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (c) 2023–2024 KudoAI & contributors under the MIT license
|
|
2
2
|
// Source: https://github.com/kudoai/chatgpt.js
|
|
3
|
-
// Latest minified release: https://
|
|
3
|
+
// Latest minified release: https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js/chatgpt.min.js
|
|
4
4
|
|
|
5
5
|
// Init endpoints
|
|
6
6
|
const endpoints = {
|
|
@@ -898,16 +898,16 @@ const chatgpt = {
|
|
|
898
898
|
getChatInput: function() { return chatgpt.getChatBox().value; },
|
|
899
899
|
|
|
900
900
|
getContinueGeneratingButton: function() {
|
|
901
|
-
|
|
902
|
-
if (
|
|
903
|
-
return
|
|
904
|
-
}}},
|
|
901
|
+
document.querySelectorAll('button svg').forEach(svg => {
|
|
902
|
+
if (svg.querySelector('polygon[points*="11 19 2 12 11 5 11 19"]')) {
|
|
903
|
+
return svg.parentNode.parentNode;
|
|
904
|
+
}});},
|
|
905
905
|
|
|
906
906
|
getLastPrompt: function() { return chatgpt.getChatData('active', 'msg', 'user', 'latest'); },
|
|
907
907
|
getLastResponse: function() { return chatgpt.getChatData('active', 'msg', 'chatgpt', 'latest'); },
|
|
908
908
|
|
|
909
909
|
getNewChatLink: function() {
|
|
910
|
-
for (const navLink of document.querySelectorAll('nav
|
|
910
|
+
for (const navLink of document.querySelectorAll('nav a')) {
|
|
911
911
|
if (/(new|clear) chat/i.test(navLink.text)) {
|
|
912
912
|
return navLink;
|
|
913
913
|
}}},
|
|
@@ -934,10 +934,10 @@ const chatgpt = {
|
|
|
934
934
|
getSendButton: function() { return document.querySelector('form button[class*="bottom"]'); },
|
|
935
935
|
|
|
936
936
|
getStopGeneratingButton: function() {
|
|
937
|
-
|
|
938
|
-
if (
|
|
939
|
-
return
|
|
940
|
-
}}
|
|
937
|
+
document.querySelectorAll('form button svg').forEach(svg => {
|
|
938
|
+
if (svg.querySelector('path[d*="2 0 0 1 2"]'))
|
|
939
|
+
return svg.parentNode;
|
|
940
|
+
});},
|
|
941
941
|
|
|
942
942
|
getUserLanguage: function() {
|
|
943
943
|
return navigator.languages[0] || navigator.language || navigator.browserLanguage ||
|
|
@@ -948,7 +948,7 @@ const chatgpt = {
|
|
|
948
948
|
deactivate: function() { this.isOn() ? this.toggle() : console.info('Chat history is already disabled!'); },
|
|
949
949
|
|
|
950
950
|
isOn: function() {
|
|
951
|
-
const navDivs = document.querySelectorAll('nav
|
|
951
|
+
const navDivs = document.querySelectorAll('nav div'),
|
|
952
952
|
offDiv = [...navDivs].find(div => div.textContent.includes('Chat History is off')) || {};
|
|
953
953
|
return offDiv.classList.toString().includes('invisible');
|
|
954
954
|
},
|
|
@@ -958,14 +958,14 @@ const chatgpt = {
|
|
|
958
958
|
isLoaded: function() {
|
|
959
959
|
return new Promise(resolve => {
|
|
960
960
|
const checkChatHistory = () => {
|
|
961
|
-
if (document.querySelector('nav
|
|
961
|
+
if (document.querySelector('nav')) resolve(true);
|
|
962
962
|
else setTimeout(checkChatHistory, 100);
|
|
963
963
|
};
|
|
964
964
|
checkChatHistory();
|
|
965
965
|
});},
|
|
966
966
|
|
|
967
967
|
toggle: function() {
|
|
968
|
-
for (const navBtn of document.querySelectorAll('nav
|
|
968
|
+
for (const navBtn of document.querySelectorAll('nav button')) {
|
|
969
969
|
if (/chat history/i.test(navBtn.textContent)) {
|
|
970
970
|
navBtn.click(); return;
|
|
971
971
|
}}}
|
|
@@ -1554,10 +1554,10 @@ const chatgpt = {
|
|
|
1554
1554
|
}}},
|
|
1555
1555
|
|
|
1556
1556
|
stopGenerating: function() {
|
|
1557
|
-
|
|
1558
|
-
if (
|
|
1559
|
-
|
|
1560
|
-
}}}
|
|
1557
|
+
document.querySelectorAll('form button svg').forEach(svg => {
|
|
1558
|
+
if (svg.querySelector('path[d*="2 0 0 1 2"]')) {
|
|
1559
|
+
svg.parentNode.click(); return;
|
|
1560
|
+
}});}
|
|
1561
1561
|
},
|
|
1562
1562
|
|
|
1563
1563
|
reviewCode: function() { chatgpt.code.review(); },
|
|
@@ -1585,7 +1585,7 @@ const chatgpt = {
|
|
|
1585
1585
|
|
|
1586
1586
|
sendInNewChat: function(msg) {
|
|
1587
1587
|
if (typeof msg !== 'string') return console.error('Message must be a string!');
|
|
1588
|
-
for (const navLink of document.querySelectorAll('nav
|
|
1588
|
+
for (const navLink of document.querySelectorAll('nav a')) {
|
|
1589
1589
|
if (/(new|clear) chat/i.test(navLink.text)) {
|
|
1590
1590
|
navLink.click(); break;
|
|
1591
1591
|
}} setTimeout(() => { chatgpt.send(msg); }, 500);
|
|
@@ -1716,7 +1716,7 @@ const chatgpt = {
|
|
|
1716
1716
|
elements: [], observer: {},
|
|
1717
1717
|
|
|
1718
1718
|
activateObserver: function() {
|
|
1719
|
-
const chatHistoryNav = document.querySelector('nav
|
|
1719
|
+
const chatHistoryNav = document.querySelector('nav'),
|
|
1720
1720
|
firstButton = chatHistoryNav.querySelector('a');
|
|
1721
1721
|
if (chatgpt.history.isOff()) // Hide enable history spam div
|
|
1722
1722
|
try { firstButton.parentNode.nextElementSibling.style.display = 'none'; } catch (err) {}
|
|
@@ -1729,7 +1729,7 @@ const chatgpt = {
|
|
|
1729
1729
|
|
|
1730
1730
|
let cssClasses;
|
|
1731
1731
|
// Grab CSS from original website elements
|
|
1732
|
-
for (let navLink of document.querySelectorAll('nav
|
|
1732
|
+
for (let navLink of document.querySelectorAll('nav a')) {
|
|
1733
1733
|
if (/.*chat/.exec(navLink.text)[0]) {
|
|
1734
1734
|
cssClasses = navLink.classList;
|
|
1735
1735
|
navLink.parentNode.style.margin = '2px 0'; // add v-margins to ensure consistency across all inserted buttons
|
|
@@ -1744,7 +1744,7 @@ const chatgpt = {
|
|
|
1744
1744
|
element.style.margin = '2px 0';
|
|
1745
1745
|
});
|
|
1746
1746
|
|
|
1747
|
-
const navBar = document.querySelector('nav
|
|
1747
|
+
const navBar = document.querySelector('nav');
|
|
1748
1748
|
// Create MutationObserver instance
|
|
1749
1749
|
this.observer = new MutationObserver(mutations => {
|
|
1750
1750
|
mutations.forEach(mutation => {
|
|
@@ -1847,7 +1847,7 @@ const chatgpt = {
|
|
|
1847
1847
|
},
|
|
1848
1848
|
|
|
1849
1849
|
startNewChat: function() {
|
|
1850
|
-
for (const navLink of document.querySelectorAll('nav
|
|
1850
|
+
for (const navLink of document.querySelectorAll('nav a')) {
|
|
1851
1851
|
if (/(new|clear) chat/i.test(navLink.text)) {
|
|
1852
1852
|
navLink.click(); return;
|
|
1853
1853
|
}}},
|