@kudoai/chatgpt.js 2.6.9 → 2.7.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 +28 -26
- package/chatgpt.js +26 -43
- package/dist/chatgpt.min.js +3 -3
- package/docs/README.md +28 -26
- package/docs/USERGUIDE.md +94 -14
- package/package.json +5 -5
- package/starters/chrome/LICENSE.md +2 -2
- package/starters/chrome/docs/README.md +2 -2
- package/starters/chrome/docs/SECURITY.md +2 -2
- package/starters/chrome/extension/lib/chatgpt.js +26 -43
- package/starters/chrome/extension/manifest.json +1 -1
- package/starters/chrome/extension/popup/index.html +1 -1
- package/starters/chrome/extension/popup/popup.js +1 -1
- package/starters/docs/README.md +1 -1
- package/starters/greasemonkey/LICENSE.md +2 -2
- package/starters/greasemonkey/chatgpt.js-greasemonkey-starter.user.js +2 -2
- package/starters/greasemonkey/docs/SECURITY.md +2 -2
package/docs/USERGUIDE.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
3
|
<picture>
|
|
4
|
-
<source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://
|
|
5
|
-
<img width=700 src="https://
|
|
4
|
+
<source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://media.chatgptjs.org/images/logos/chatgpt.js/with-reflection/darkmode.png?bc68d0c">
|
|
5
|
+
<img width=700 src="https://media.chatgptjs.org/images/logos/chatgpt.js/with-reflection/lightmode.png?bc68d0c">
|
|
6
6
|
</picture>
|
|
7
7
|
|
|
8
8
|
**chatgpt.js** is a powerful JavaScript library that allows for super easy interaction w/ the ChatGPT DOM.
|
|
@@ -73,10 +73,17 @@
|
|
|
73
73
|
- [DOM related](#dom-related)
|
|
74
74
|
- [getChatBox](#getchatbox)
|
|
75
75
|
- [getContinueGeneratingButton](#getcontinuegeneratingbutton)
|
|
76
|
+
- [getFooterDiv](#getfooterdiv)
|
|
77
|
+
- [getHeaderDiv](#getheaderdiv)
|
|
76
78
|
- [getNewChatLink](#getnewchatlink)
|
|
77
79
|
- [getRegenerateButton](#getregeneratebutton)
|
|
80
|
+
- [getScrollToBottomButton](#getscrolltobottombutton)
|
|
78
81
|
- [getSendButton](#getsendbutton)
|
|
79
82
|
- [getStopGeneratingButton](#getstopgeneratingbutton)
|
|
83
|
+
- [hideFooter](#hidefooter)
|
|
84
|
+
- [hideHeader](#hideheader)
|
|
85
|
+
- [showFooter](#showfooter)
|
|
86
|
+
- [showHeader](#showheader)
|
|
80
87
|
- [Library APIs](#library-apis)
|
|
81
88
|
- [autoRefresh `api`](#autorefresh-api)
|
|
82
89
|
- [activate](#activate)
|
|
@@ -132,13 +139,13 @@
|
|
|
132
139
|
|
|
133
140
|
# Importing the library
|
|
134
141
|
|
|
135
|
-
> **Note** _To always import the latest version (
|
|
142
|
+
> **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`_
|
|
136
143
|
|
|
137
144
|
## ES6
|
|
138
145
|
|
|
139
146
|
```js
|
|
140
147
|
(async () => {
|
|
141
|
-
await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@2.
|
|
148
|
+
await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@2.7.0/dist/chatgpt.min.js');
|
|
142
149
|
// Your code here...
|
|
143
150
|
})();
|
|
144
151
|
```
|
|
@@ -147,7 +154,7 @@
|
|
|
147
154
|
|
|
148
155
|
```js
|
|
149
156
|
var xhr = new XMLHttpRequest();
|
|
150
|
-
xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@2.
|
|
157
|
+
xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@2.7.0/dist/chatgpt.min.js');
|
|
151
158
|
xhr.onload = function () {
|
|
152
159
|
if (xhr.status === 200) {
|
|
153
160
|
var chatgptJS = document.createElement('script');
|
|
@@ -169,7 +176,7 @@ function yourCode() {
|
|
|
169
176
|
|
|
170
177
|
```js
|
|
171
178
|
...
|
|
172
|
-
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@2.
|
|
179
|
+
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@2.7.0/dist/chatgpt.min.js
|
|
173
180
|
// ==/UserScript==
|
|
174
181
|
|
|
175
182
|
// Your code here...
|
|
@@ -1076,8 +1083,30 @@ Returns the 'Continue generating' button as an HTML element.
|
|
|
1076
1083
|
Example code:
|
|
1077
1084
|
|
|
1078
1085
|
```js
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1086
|
+
const continueBtn = chatgpt.getContinueGeneratingButton();
|
|
1087
|
+
continueBtn.click();
|
|
1088
|
+
```
|
|
1089
|
+
|
|
1090
|
+
### getFooterDiv
|
|
1091
|
+
|
|
1092
|
+
Returns the footer div as an HTML element.
|
|
1093
|
+
|
|
1094
|
+
Example code:
|
|
1095
|
+
|
|
1096
|
+
```js
|
|
1097
|
+
const footerDiv = chatgpt.getFooterDiv();
|
|
1098
|
+
footerDiv.style.padding = '15px'; // make the footer taller
|
|
1099
|
+
```
|
|
1100
|
+
|
|
1101
|
+
### getHeaderDiv
|
|
1102
|
+
|
|
1103
|
+
Returns the header div as an HTML element.
|
|
1104
|
+
|
|
1105
|
+
Example code:
|
|
1106
|
+
|
|
1107
|
+
```js
|
|
1108
|
+
const headerDiv = chatgpt.getHeaderDiv();
|
|
1109
|
+
headerDiv.style.display = none; // hide the header
|
|
1081
1110
|
```
|
|
1082
1111
|
|
|
1083
1112
|
### getNewChatLink
|
|
@@ -1098,8 +1127,19 @@ Returns the button which regenerates ChatGPT's response as an HTML element.
|
|
|
1098
1127
|
Example code:
|
|
1099
1128
|
|
|
1100
1129
|
```js
|
|
1101
|
-
const
|
|
1102
|
-
|
|
1130
|
+
const regenBtn = chatgpt.getRegenerateButton();
|
|
1131
|
+
regenBtn.click();
|
|
1132
|
+
```
|
|
1133
|
+
|
|
1134
|
+
### getScrollToBottomButton
|
|
1135
|
+
|
|
1136
|
+
Returns the button which scrolls to bottom as an HTML element.
|
|
1137
|
+
|
|
1138
|
+
Example code:
|
|
1139
|
+
|
|
1140
|
+
```js
|
|
1141
|
+
const scrollToBottomBtn = chatgpt.getScrollToBottomButton();
|
|
1142
|
+
scrollToBottomBtn.click();
|
|
1103
1143
|
```
|
|
1104
1144
|
|
|
1105
1145
|
### getSendButton
|
|
@@ -1109,8 +1149,8 @@ Returns the button which sends the message as an HTML element.
|
|
|
1109
1149
|
Example code:
|
|
1110
1150
|
|
|
1111
1151
|
```js
|
|
1112
|
-
const
|
|
1113
|
-
|
|
1152
|
+
const sendBtn = chatgpt.getSendButton();
|
|
1153
|
+
sendBtn.click();
|
|
1114
1154
|
```
|
|
1115
1155
|
|
|
1116
1156
|
### getStopGeneratingButton
|
|
@@ -1120,8 +1160,48 @@ Returns the button which stops the generation of ChatGPT's response as an HTML e
|
|
|
1120
1160
|
Example code:
|
|
1121
1161
|
|
|
1122
1162
|
```js
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1163
|
+
const stopBtn = chatgpt.getStopGeneratingButton();
|
|
1164
|
+
stopBtn.click();
|
|
1165
|
+
```
|
|
1166
|
+
|
|
1167
|
+
### hideFooter
|
|
1168
|
+
|
|
1169
|
+
Hides the footer div.
|
|
1170
|
+
|
|
1171
|
+
Example code:
|
|
1172
|
+
|
|
1173
|
+
```js
|
|
1174
|
+
chatgpt.hideFooter()
|
|
1175
|
+
```
|
|
1176
|
+
|
|
1177
|
+
### hideHeader
|
|
1178
|
+
|
|
1179
|
+
Hides the header div.
|
|
1180
|
+
|
|
1181
|
+
Example code:
|
|
1182
|
+
|
|
1183
|
+
```js
|
|
1184
|
+
chatgpt.hideHeader()
|
|
1185
|
+
```
|
|
1186
|
+
|
|
1187
|
+
### showFooter
|
|
1188
|
+
|
|
1189
|
+
Shows the footer div if hidden.
|
|
1190
|
+
|
|
1191
|
+
Example code:
|
|
1192
|
+
|
|
1193
|
+
```js
|
|
1194
|
+
chatgpt.showFooter()
|
|
1195
|
+
```
|
|
1196
|
+
|
|
1197
|
+
### showHeader
|
|
1198
|
+
|
|
1199
|
+
Shows the header div if hidden.
|
|
1200
|
+
|
|
1201
|
+
Example code:
|
|
1202
|
+
|
|
1203
|
+
```js
|
|
1204
|
+
chatgpt.showHeader()
|
|
1125
1205
|
```
|
|
1126
1206
|
|
|
1127
1207
|
# Library APIs
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kudoai/chatgpt.js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Client-side JavaScript library for ChatGPT",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "KudoAI & contributors",
|
|
7
|
-
"email": "
|
|
7
|
+
"email": "opensource@kudoai.com",
|
|
8
8
|
"url": "https://www.kudoai.com"
|
|
9
9
|
},
|
|
10
10
|
"homepage": "https://chatgpt.js.org",
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"url": "https://github.com/sponsors/KudoAI"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@adamlui/minify.js": "^1.
|
|
67
|
-
"@adamlui/scss-to-css": "^1.
|
|
66
|
+
"@adamlui/minify.js": "^1.6.1",
|
|
67
|
+
"@adamlui/scss-to-css": "^1.9.0",
|
|
68
68
|
"docsify-cli": "^4.4.4",
|
|
69
|
-
"eslint": "^9.
|
|
69
|
+
"eslint": "^9.2.0",
|
|
70
70
|
"eslint-plugin-json-schema-validator": "^5.1.0",
|
|
71
71
|
"husky": "^9.0.11"
|
|
72
72
|
}
|
|
@@ -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://
|
|
5
|
-
<img height=14 src="https://
|
|
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">
|
|
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://
|
|
5
|
-
<img height=14 src="https://
|
|
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">
|
|
6
6
|
</picture>
|
|
7
7
|
English |
|
|
8
8
|
<a href="zh-cn#readme">简体中文</a> |
|
|
@@ -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://
|
|
5
|
-
<img height=14 src="https://
|
|
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">
|
|
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> |
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
// Init endpoints
|
|
7
7
|
const endpoints = {
|
|
8
|
-
assets: 'https://
|
|
8
|
+
assets: 'https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js',
|
|
9
9
|
openAI: {
|
|
10
|
-
session: 'https://
|
|
10
|
+
session: 'https://chatgpt.com/api/auth/session',
|
|
11
11
|
chats: 'https://chat.openai.com/backend-api/conversations',
|
|
12
12
|
chat: 'https://chat.openai.com/backend-api/conversation',
|
|
13
13
|
share_create: 'https://chat.openai.com/backend-api/share/create',
|
|
@@ -18,14 +18,7 @@ const endpoints = {
|
|
|
18
18
|
|
|
19
19
|
// Init feedback properties
|
|
20
20
|
localStorage.alertQueue = JSON.stringify([]);
|
|
21
|
-
localStorage.notifyProps = JSON.stringify({
|
|
22
|
-
queue: { topRight: [], bottomRight: [], bottomLeft: [], topLeft: [] },
|
|
23
|
-
lastNthAudio: 0 // to prevent immediate repetition of base sound
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// Init environment flags
|
|
27
|
-
const isFFuserScript = navigator.userAgent.includes('Firefox') && typeof unsafeWindow != 'undefined',
|
|
28
|
-
isFFtmScript = isFFuserScript && GM_info.scriptHandler == 'Tampermonkey';
|
|
21
|
+
localStorage.notifyProps = JSON.stringify({ queue: { topRight: [], bottomRight: [], bottomLeft: [], topLeft: [] }});
|
|
29
22
|
|
|
30
23
|
// Define chatgpt.methods
|
|
31
24
|
const chatgpt = { // eslint-disable-line no-redeclare
|
|
@@ -865,6 +858,8 @@ const chatgpt = { // eslint-disable-line no-redeclare
|
|
|
865
858
|
return svg.parentNode.parentNode;
|
|
866
859
|
}},
|
|
867
860
|
|
|
861
|
+
getFooterDiv: function() { return document.querySelector('main form').parentNode.parentNode.nextElementSibling; },
|
|
862
|
+
getHeaderDiv: function() { return document.querySelector('main .sticky'); },
|
|
868
863
|
getLastPrompt: function() { return chatgpt.getChatData('active', 'msg', 'user', 'latest'); },
|
|
869
864
|
getLastResponse: function() { return chatgpt.getChatData('active', 'msg', 'chatgpt', 'latest'); },
|
|
870
865
|
|
|
@@ -876,8 +871,8 @@ const chatgpt = { // eslint-disable-line no-redeclare
|
|
|
876
871
|
|
|
877
872
|
getRegenerateButton: function() {
|
|
878
873
|
for (const mainSVG of document.querySelectorAll('main svg')) {
|
|
879
|
-
if (mainSVG.querySelector('path[d*="
|
|
880
|
-
return mainSVG.parentNode
|
|
874
|
+
if (mainSVG.querySelector('path[d*="M3.07 10.876C3.623"]')) // regen icon found
|
|
875
|
+
return mainSVG.parentNode;
|
|
881
876
|
}},
|
|
882
877
|
|
|
883
878
|
getResponse: function() {
|
|
@@ -893,6 +888,7 @@ const chatgpt = { // eslint-disable-line no-redeclare
|
|
|
893
888
|
|
|
894
889
|
getResponseFromAPI: function(chatToGet, responseToGet) { return chatgpt.response.getFromAPI(chatToGet, responseToGet); },
|
|
895
890
|
getResponseFromDOM: function(pos) { return chatgpt.response.getFromDOM(pos); },
|
|
891
|
+
getScrollToBottomButton: function() { return document.querySelector('button[class*="cursor"][class*="bottom"]'); },
|
|
896
892
|
getSendButton: function() { return document.querySelector('form button[class*="bottom"]'); },
|
|
897
893
|
|
|
898
894
|
getStopGeneratingButton: function() {
|
|
@@ -905,6 +901,9 @@ const chatgpt = { // eslint-disable-line no-redeclare
|
|
|
905
901
|
return navigator.languages[0] || navigator.language || navigator.browserLanguage ||
|
|
906
902
|
navigator.systemLanguage || navigator.userLanguage || ''; },
|
|
907
903
|
|
|
904
|
+
hideFooter: function() { chatgpt.getFooterDiv().style.display = 'none'; },
|
|
905
|
+
hideHeader: function() { chatgpt.getHeaderDiv().style.display = 'none'; },
|
|
906
|
+
|
|
908
907
|
history: {
|
|
909
908
|
isLoaded: function() {
|
|
910
909
|
return new Promise(resolve => {
|
|
@@ -1263,28 +1262,10 @@ const chatgpt = { // eslint-disable-line no-redeclare
|
|
|
1263
1262
|
const hideDelay = fadeDuration > notifDuration ? 0 // don't delay if fade exceeds notification duration
|
|
1264
1263
|
: notifDuration - fadeDuration; // otherwise delay for difference
|
|
1265
1264
|
|
|
1266
|
-
// Init/schedule audio feedback
|
|
1267
|
-
let dismissAudio, dismissAudioTID; // be accessible to `dismissNotif()`
|
|
1268
|
-
if (isFFtmScript) {
|
|
1269
|
-
// Init base audio index
|
|
1270
|
-
let nthAudio; do nthAudio = Math.floor(Math.random() * 3) + 1; // randomize between 1-3...
|
|
1271
|
-
while (nthAudio === notifyProps.lastNthAudio); // ...until distinct from prev index (for variety)
|
|
1272
|
-
notifyProps.lastNthAudio = nthAudio; localStorage.notifyProps = JSON.stringify(notifyProps);
|
|
1273
|
-
|
|
1274
|
-
// Build audio element + src URL
|
|
1275
|
-
dismissAudio = new Audio();
|
|
1276
|
-
dismissAudio.src = endpoints.assets + '/media/audio/notifications/bubble-pop/'
|
|
1277
|
-
+ `${ nthAudio }-${ notificationDiv.isRight ? 'right' : 'left' }.mp3`;
|
|
1278
|
-
|
|
1279
|
-
// Schedule playback
|
|
1280
|
-
dismissAudioTID = setTimeout(() => dismissAudio.play().catch(() => {}), hideDelay * 1000);
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
1265
|
// Add notification dismissal to timeout schedule + button clicks
|
|
1284
1266
|
const dismissNotif = () => {
|
|
1285
1267
|
notificationDiv.style.animation = `notif-zoom-fade-out ${ fadeDuration }s ease-out`;
|
|
1286
|
-
|
|
1287
|
-
clearTimeout(dismissFuncTID); clearTimeout(dismissAudioTID);
|
|
1268
|
+
clearTimeout(dismissFuncTID);
|
|
1288
1269
|
};
|
|
1289
1270
|
const dismissFuncTID = setTimeout(dismissNotif, hideDelay * 1000); // maintain visibility for `hideDelay` secs, then dismiss
|
|
1290
1271
|
closeSVG.addEventListener('click', dismissNotif, { once: true }); // add to close button clicks
|
|
@@ -1373,12 +1354,7 @@ const chatgpt = { // eslint-disable-line no-redeclare
|
|
|
1373
1354
|
},
|
|
1374
1355
|
|
|
1375
1356
|
refactor: function() { chatgpt.code.refactor(); },
|
|
1376
|
-
|
|
1377
|
-
regenerate: function() {
|
|
1378
|
-
for (const formButton of document.querySelectorAll('form button')) {
|
|
1379
|
-
if (formButton.textContent.toLowerCase().includes('regenerate')) {
|
|
1380
|
-
formButton.click(); return;
|
|
1381
|
-
}}},
|
|
1357
|
+
regenerate: function() { chatgpt.response.regenerate(); },
|
|
1382
1358
|
|
|
1383
1359
|
renderHTML: function(node) {
|
|
1384
1360
|
const reTags = /<([a-z\d]+)\b([^>]*)>([\s\S]*?)<\/\1>/g,
|
|
@@ -1493,10 +1469,10 @@ const chatgpt = { // eslint-disable-line no-redeclare
|
|
|
1493
1469
|
getLast: function() { return chatgpt.getChatData('active', 'msg', 'chatgpt', 'latest'); },
|
|
1494
1470
|
|
|
1495
1471
|
regenerate: function() {
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
}
|
|
1472
|
+
const regenBtn = chatgpt.getRegenerateButton();
|
|
1473
|
+
if (regenBtn) regenBtn.click();
|
|
1474
|
+
else console.error('Regenerate button not found!');
|
|
1475
|
+
},
|
|
1500
1476
|
|
|
1501
1477
|
stopGenerating: function() {
|
|
1502
1478
|
for (const svg of document.querySelectorAll('form button svg')) {
|
|
@@ -1508,8 +1484,9 @@ const chatgpt = { // eslint-disable-line no-redeclare
|
|
|
1508
1484
|
reviewCode: function() { chatgpt.code.review(); },
|
|
1509
1485
|
|
|
1510
1486
|
scrollToBottom: function() {
|
|
1511
|
-
|
|
1512
|
-
|
|
1487
|
+
const scrollBtn = chatgpt.getScrollToBottomButton();
|
|
1488
|
+
if (scrollBtn) scrollBtn.click();
|
|
1489
|
+
else console.error('Scroll button not found!');
|
|
1513
1490
|
},
|
|
1514
1491
|
|
|
1515
1492
|
send: function(msg, method='') {
|
|
@@ -1657,6 +1634,9 @@ const chatgpt = { // eslint-disable-line no-redeclare
|
|
|
1657
1634
|
});});});});});
|
|
1658
1635
|
},
|
|
1659
1636
|
|
|
1637
|
+
showFooter: function() { chatgpt.getFooterDiv().style.display = 'revert'; },
|
|
1638
|
+
showHeader: function() { chatgpt.getHeaderDiv().style.display = 'flex'; },
|
|
1639
|
+
|
|
1660
1640
|
sidebar: {
|
|
1661
1641
|
elements: [], observer: {},
|
|
1662
1642
|
|
|
@@ -1905,6 +1885,8 @@ const functionAliases = [
|
|
|
1905
1885
|
['detectLanguage', 'getLanguage'],
|
|
1906
1886
|
['executeCode', 'codeExecute'],
|
|
1907
1887
|
['exportChat', 'chatExport', 'export'],
|
|
1888
|
+
['getFooterDiv', 'getFooter'],
|
|
1889
|
+
['getHeaderDiv', 'getHeader'],
|
|
1908
1890
|
['getLastPrompt', 'getLastQuery', 'getMyLastMsg', 'getMyLastQuery'],
|
|
1909
1891
|
['getTextarea', 'getTextArea', 'getChatbox', 'getChatBox'],
|
|
1910
1892
|
['isFullScreen', 'isFullscreen'],
|
|
@@ -1934,6 +1916,7 @@ const synonyms = [
|
|
|
1934
1916
|
['activate', 'turnOn'],
|
|
1935
1917
|
['analyze', 'check', 'evaluate', 'review'],
|
|
1936
1918
|
['ask', 'send', 'submit'],
|
|
1919
|
+
['button', 'btn'],
|
|
1937
1920
|
['chat', 'conversation', 'convo'],
|
|
1938
1921
|
['data', 'details'],
|
|
1939
1922
|
['deactivate', 'deActivate', 'turnOff'],
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
</div>
|
|
43
43
|
-->
|
|
44
44
|
<footer>
|
|
45
|
-
<div class="chatgpt-js"><a title="Powered by chatgpt.js" href="https://chatgpt.js.org" target="_blank" rel="noopener"><img src="https://
|
|
45
|
+
<div class="chatgpt-js"><a title="Powered by chatgpt.js" href="https://chatgpt.js.org" target="_blank" rel="noopener"><img src="https://media.chatgptjs.org/images/badges/powered-by-chatgpt.js-faded.png"></a></div>
|
|
46
46
|
<span title="Check for Updates" class="menu-icon menu-area" style="right:58px ; padding-top: 7px" >
|
|
47
47
|
<img width=15 height=15 src="https://i.imgur.com/Luxs8j5.png" style="margin-top: 0.04rem">
|
|
48
48
|
</span>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
// Add Powered by chatgpt.js hover-listener
|
|
45
|
-
const chatGPTjsHostPath = 'https://
|
|
45
|
+
const chatGPTjsHostPath = 'https://media.chatgptjs.org/images/badges/',
|
|
46
46
|
chatGPTjsImg = document.querySelector('.chatgpt-js img');
|
|
47
47
|
chatGPTjsImg.addEventListener('mouseover', () => {
|
|
48
48
|
chatGPTjsImg.src = chatGPTjsHostPath + 'powered-by-chatgpt.js.png'; });
|
package/starters/docs/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Template for creating a Chrome extension using chatgpt.js (including pop-up menu
|
|
|
18
18
|
|
|
19
19
|
[Repo](https://github.com/KudoAI/chatgpt.js-chrome-starter) / [Readme](../chrome#readme) / [Get help](https://github.com/KudoAI/chatgpt.js-chrome-starter/issues)
|
|
20
20
|
|
|
21
|
-
<h2><a href="../greasemonkey"><img style="margin: 0 2px -0.065rem 0" height=19 src="https://
|
|
21
|
+
<h2><a href="../greasemonkey"><img style="margin: 0 2px -0.065rem 0" height=19 src="https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@e26f2cf/starters/media/images/icons/tampermonkey-icon28.png"><img style="margin: 0 2px -0.035rem 1px" height=19.5 src="https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@0c37090/starters/media/images/icons/violentmonkey-icon100.png"></a> <a href="../greasemonkey">Greasemonkey starter</a></h2>
|
|
22
22
|
|
|
23
23
|
Template for creating a Greasemonkey userscript using chatgpt.js
|
|
24
24
|
|
|
@@ -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://
|
|
5
|
-
<img height=14 src="https://
|
|
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">
|
|
6
6
|
</picture>
|
|
7
7
|
English |
|
|
8
8
|
<a href="docs/zh-cn/LICENSE.md">简体中文</a> |
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// @description A Greasemonkey template to start using chatgpt.js like a boss
|
|
4
4
|
// @author chatgpt.js
|
|
5
5
|
// @namespace https://chatgpt.js.org
|
|
6
|
-
// @version 2024.5.
|
|
6
|
+
// @version 2024.5.9
|
|
7
7
|
// @license MIT
|
|
8
8
|
// @match https://chat.openai.com/*
|
|
9
9
|
// @icon https://raw.githubusercontent.com/KudoAI/chatgpt.js-greasemonkey-starter/main/media/images/icons/robot/icon48.png
|
|
10
10
|
// @icon64 https://raw.githubusercontent.com/KudoAI/chatgpt.js-greasemonkey-starter/main/media/images/icons/robot/icon64.png
|
|
11
|
-
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@2.
|
|
11
|
+
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@2.7.0/dist/chatgpt.min.js
|
|
12
12
|
// @grant GM_getValue
|
|
13
13
|
// @grant GM_setValue
|
|
14
14
|
// @noframes
|
|
@@ -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://
|
|
5
|
-
<img height=14 src="https://
|
|
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">
|
|
6
6
|
</picture>
|
|
7
7
|
English |
|
|
8
8
|
<a href="https://github.com/KudoAI/chatgpt.js-greasemonkey-starter/blob/main/docs/zh-cn/SECURITY.md">简体中文</a> |
|