@kudoai/chatgpt.js 2.6.7 → 2.6.9
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/LICENSE.md +9 -0
- package/README.md +30 -34
- package/chatgpt.js +2001 -2060
- package/dist/chatgpt.min.js +9 -3
- package/docs/README.md +30 -34
- package/docs/SECURITY.md +25 -25
- package/docs/USERGUIDE.md +6 -65
- package/package.json +73 -73
- package/starters/chrome/LICENSE.md +31 -43
- package/starters/chrome/docs/README.md +93 -93
- package/starters/chrome/docs/SECURITY.md +17 -17
- package/starters/chrome/extension/background.js +14 -14
- package/starters/chrome/extension/content.js +62 -62
- package/starters/chrome/extension/lib/chatgpt.js +2002 -2061
- package/starters/chrome/extension/lib/settings-utils.js +24 -24
- package/starters/chrome/extension/manifest.json +24 -24
- package/starters/chrome/extension/popup/index.html +62 -62
- package/starters/chrome/extension/popup/popup.js +92 -92
- package/starters/chrome/extension/popup/style.css +55 -55
- package/starters/docs/LICENSE.md +13 -25
- package/starters/docs/README.md +29 -29
- package/starters/greasemonkey/LICENSE.md +31 -43
- package/starters/greasemonkey/chatgpt.js-greasemonkey-starter.user.js +5 -5
- package/starters/greasemonkey/docs/README.md +7 -7
- package/starters/greasemonkey/docs/SECURITY.md +17 -17
- package/LICENSE +0 -21
- package/docs/de/LICENSE.md +0 -29
- package/docs/de/README.md +0 -343
- package/docs/de/SECURITY.md +0 -25
- package/docs/es/LICENSE.md +0 -29
- package/docs/es/README.md +0 -343
- package/docs/es/SECURITY.md +0 -25
- package/docs/fr/LICENSE.md +0 -29
- package/docs/fr/README.md +0 -343
- package/docs/fr/SECURITY.md +0 -25
- package/docs/hi/LICENSE.md +0 -29
- package/docs/hi/README.md +0 -344
- package/docs/hi/SECURITY.md +0 -25
- package/docs/it/LICENSE.md +0 -27
- package/docs/it/README.md +0 -343
- package/docs/it/SECURITY.md +0 -25
- package/docs/ja/LICENSE.md +0 -29
- package/docs/ja/README.md +0 -343
- package/docs/ja/SECURITY.md +0 -25
- package/docs/ko/LICENSE.md +0 -32
- package/docs/ko/README.md +0 -348
- package/docs/ko/SECURITY.md +0 -25
- package/docs/ne/LICENSE.md +0 -35
- package/docs/ne/README.md +0 -344
- package/docs/ne/SECURITY.md +0 -25
- package/docs/nl/LICENSE.md +0 -29
- package/docs/nl/README.md +0 -343
- package/docs/nl/SECURITY.md +0 -25
- package/docs/pt/LICENSE.md +0 -29
- package/docs/pt/README.md +0 -343
- package/docs/pt/SECURITY.md +0 -25
- package/docs/vi/LICENSE.md +0 -29
- package/docs/vi/README.md +0 -343
- package/docs/vi/SECURITY.md +0 -25
- package/docs/zh-cn/LICENSE.md +0 -29
- package/docs/zh-cn/README.md +0 -343
- package/docs/zh-cn/SECURITY.md +0 -25
- package/docs/zh-tw/LICENSE.md +0 -29
- package/docs/zh-tw/README.md +0 -342
- package/docs/zh-tw/SECURITY.md +0 -25
- package/starters/chrome/docs/de/LICENSE.md +0 -31
- package/starters/chrome/docs/de/README.md +0 -93
- package/starters/chrome/docs/es/LICENSE.md +0 -31
- package/starters/chrome/docs/es/README.md +0 -93
- package/starters/chrome/docs/fr/LICENSE.md +0 -31
- package/starters/chrome/docs/fr/README.md +0 -93
- package/starters/chrome/docs/hi/LICENSE.md +0 -31
- package/starters/chrome/docs/hi/README.md +0 -93
- package/starters/chrome/docs/hi/SECURITY.md +0 -17
- package/starters/chrome/docs/it/LICENSE.md +0 -29
- package/starters/chrome/docs/it/README.md +0 -93
- package/starters/chrome/docs/ja/LICENSE.md +0 -31
- package/starters/chrome/docs/ja/README.md +0 -93
- package/starters/chrome/docs/ko/LICENSE.md +0 -34
- package/starters/chrome/docs/ko/README.md +0 -93
- package/starters/chrome/docs/nl/LICENSE.md +0 -30
- package/starters/chrome/docs/nl/README.md +0 -93
- package/starters/chrome/docs/pt/LICENSE.md +0 -31
- package/starters/chrome/docs/pt/README.md +0 -93
- package/starters/chrome/docs/vi/LICENSE.md +0 -31
- package/starters/chrome/docs/vi/README.md +0 -93
- package/starters/chrome/docs/zh-cn/LICENSE.md +0 -31
- package/starters/chrome/docs/zh-cn/README.md +0 -93
- package/starters/chrome/docs/zh-cn/SECURITY.md +0 -17
- package/starters/chrome/docs/zh-tw/LICENSE.md +0 -31
- package/starters/chrome/docs/zh-tw/README.md +0 -93
- package/starters/docs/de/LICENSE.md +0 -13
- package/starters/docs/de/README.md +0 -29
- package/starters/docs/es/LICENSE.md +0 -13
- package/starters/docs/es/README.md +0 -29
- package/starters/docs/fr/LICENSE.md +0 -13
- package/starters/docs/fr/README.md +0 -29
- package/starters/docs/hi/LICENSE.md +0 -13
- package/starters/docs/hi/README.md +0 -29
- package/starters/docs/it/LICENSE.md +0 -11
- package/starters/docs/it/README.md +0 -29
- package/starters/docs/ja/LICENSE.md +0 -13
- package/starters/docs/ja/README.md +0 -30
- package/starters/docs/ko/LICENSE.md +0 -16
- package/starters/docs/ko/README.md +0 -29
- package/starters/docs/nl/LICENSE.md +0 -13
- package/starters/docs/nl/README.md +0 -29
- package/starters/docs/pt/LICENSE.md +0 -13
- package/starters/docs/pt/README.md +0 -29
- package/starters/docs/vi/LICENSE.md +0 -13
- package/starters/docs/vi/README.md +0 -29
- package/starters/docs/zh-cn/LICENSE.md +0 -13
- package/starters/docs/zh-cn/README.md +0 -30
- package/starters/docs/zh-tw/LICENSE.md +0 -13
- package/starters/docs/zh-tw/README.md +0 -29
- package/starters/greasemonkey/docs/de/LICENSE.md +0 -31
- package/starters/greasemonkey/docs/es/LICENSE.md +0 -31
- package/starters/greasemonkey/docs/fr/LICENSE.md +0 -31
- package/starters/greasemonkey/docs/hi/LICENSE.md +0 -31
- package/starters/greasemonkey/docs/hi/SECURITY.md +0 -17
- package/starters/greasemonkey/docs/it/LICENSE.md +0 -29
- package/starters/greasemonkey/docs/ja/LICENSE.md +0 -31
- package/starters/greasemonkey/docs/ko/LICENSE.md +0 -34
- package/starters/greasemonkey/docs/nl/LICENSE.md +0 -30
- package/starters/greasemonkey/docs/pt/LICENSE.md +0 -31
- package/starters/greasemonkey/docs/vi/LICENSE.md +0 -31
- package/starters/greasemonkey/docs/zh-cn/LICENSE.md +0 -31
- package/starters/greasemonkey/docs/zh-cn/SECURITY.md +0 -17
- package/starters/greasemonkey/docs/zh-tw/LICENSE.md +0 -31
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
// NOTE: This script relies on the powerful chatgpt.js library @ https://chatgpt.js.org
|
|
2
|
-
//
|
|
3
|
-
// Source: https://github.com/KudoAI/chatgpt.js
|
|
4
|
-
// Latest minified release: https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js/chatgpt.min.js
|
|
5
|
-
|
|
6
|
-
(async () => {
|
|
7
|
-
|
|
8
|
-
// Import libs
|
|
9
|
-
const { config, settings } = await import(chrome.runtime.getURL('lib/settings-utils.js'));
|
|
10
|
-
const { chatgpt } = await import(chrome.runtime.getURL('lib/chatgpt.js'));
|
|
11
|
-
|
|
12
|
-
// Add Chrome action msg listener
|
|
13
|
-
chrome.runtime.onMessage.addListener((request) => {
|
|
14
|
-
if (request.action === 'notify') notify(request.msg, request.position);
|
|
15
|
-
else if (request.action === 'alert') alert(request.title, request.msg, request.btns);
|
|
16
|
-
else if (typeof window[request.action] === 'function') {
|
|
17
|
-
const args = Array.isArray(request.args) ? request.args // preserve array if supplied
|
|
18
|
-
: request.args !== undefined ? [request.args] : []; // convert to array if single or no arg
|
|
19
|
-
window[request.action](...args); // call expression functions
|
|
20
|
-
}
|
|
21
|
-
return true;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
await chatgpt.isLoaded();
|
|
25
|
-
chatgpt.printAllFunctions(); // to console
|
|
26
|
-
settings.load('skipAlert').then(() => {
|
|
27
|
-
if (!config.skipAlert) {
|
|
28
|
-
chatgpt.alert('≫ ChatGPT extension loaded! 🚀', // title
|
|
29
|
-
'Success! Press Ctrl+Shift+J to view all chatgpt.js methods.', // msg
|
|
30
|
-
function getHelp() { // button
|
|
31
|
-
window.open(config.ghRepoURL + '/issues', '_blank', 'noopener'); },
|
|
32
|
-
function dontShowAgain() { // checkbox
|
|
33
|
-
settings.save('skipAlert', !config.skipAlert); }
|
|
34
|
-
);}});
|
|
35
|
-
|
|
36
|
-
// Your code here...
|
|
37
|
-
// Your code here...
|
|
38
|
-
// Your code here...
|
|
39
|
-
// Your code here...
|
|
40
|
-
// Your code here...
|
|
41
|
-
// Your code here...
|
|
42
|
-
|
|
43
|
-
// Define FEEDBACK functions
|
|
44
|
-
|
|
45
|
-
function notify(msg, position = '', notifDuration = '', shadow = '') {
|
|
46
|
-
chatgpt.notify(`${ config.appSymbol } ${ msg }`, position, notifDuration,
|
|
47
|
-
shadow || chatgpt.isDarkMode() ? '' : 'shadow' ); }
|
|
48
|
-
|
|
49
|
-
function alert(title = '', msg = '', btns = '', checkbox = '', width = '') {
|
|
50
|
-
return chatgpt.alert(`${ config.appSymbol } ${ title }`, msg, btns, checkbox, width );}
|
|
51
|
-
|
|
52
|
-
// Define SYNC function
|
|
53
|
-
|
|
54
|
-
syncExtension = () => {
|
|
55
|
-
settings.load('extensionDisabled').then(() => {
|
|
56
|
-
if (config.extensionDisabled) {
|
|
57
|
-
// remove your hacks
|
|
58
|
-
} else {
|
|
59
|
-
// sync each potentially updated setting passed to settings.load()
|
|
60
|
-
}});};
|
|
61
|
-
|
|
62
|
-
})();
|
|
1
|
+
// NOTE: This script relies on the powerful chatgpt.js library @ https://chatgpt.js.org
|
|
2
|
+
// © 2023–2024 KudoAI & contributors under the MIT license
|
|
3
|
+
// Source: https://github.com/KudoAI/chatgpt.js
|
|
4
|
+
// Latest minified release: https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js/chatgpt.min.js
|
|
5
|
+
|
|
6
|
+
(async () => {
|
|
7
|
+
|
|
8
|
+
// Import libs
|
|
9
|
+
const { config, settings } = await import(chrome.runtime.getURL('lib/settings-utils.js'));
|
|
10
|
+
const { chatgpt } = await import(chrome.runtime.getURL('lib/chatgpt.js'));
|
|
11
|
+
|
|
12
|
+
// Add Chrome action msg listener
|
|
13
|
+
chrome.runtime.onMessage.addListener((request) => {
|
|
14
|
+
if (request.action === 'notify') notify(request.msg, request.position);
|
|
15
|
+
else if (request.action === 'alert') alert(request.title, request.msg, request.btns);
|
|
16
|
+
else if (typeof window[request.action] === 'function') {
|
|
17
|
+
const args = Array.isArray(request.args) ? request.args // preserve array if supplied
|
|
18
|
+
: request.args !== undefined ? [request.args] : []; // convert to array if single or no arg
|
|
19
|
+
window[request.action](...args); // call expression functions
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
await chatgpt.isLoaded();
|
|
25
|
+
chatgpt.printAllFunctions(); // to console
|
|
26
|
+
settings.load('skipAlert').then(() => {
|
|
27
|
+
if (!config.skipAlert) {
|
|
28
|
+
chatgpt.alert('≫ ChatGPT extension loaded! 🚀', // title
|
|
29
|
+
'Success! Press Ctrl+Shift+J to view all chatgpt.js methods.', // msg
|
|
30
|
+
function getHelp() { // button
|
|
31
|
+
window.open(config.ghRepoURL + '/issues', '_blank', 'noopener'); },
|
|
32
|
+
function dontShowAgain() { // checkbox
|
|
33
|
+
settings.save('skipAlert', !config.skipAlert); }
|
|
34
|
+
);}});
|
|
35
|
+
|
|
36
|
+
// Your code here...
|
|
37
|
+
// Your code here...
|
|
38
|
+
// Your code here...
|
|
39
|
+
// Your code here...
|
|
40
|
+
// Your code here...
|
|
41
|
+
// Your code here...
|
|
42
|
+
|
|
43
|
+
// Define FEEDBACK functions
|
|
44
|
+
|
|
45
|
+
function notify(msg, position = '', notifDuration = '', shadow = '') {
|
|
46
|
+
chatgpt.notify(`${ config.appSymbol } ${ msg }`, position, notifDuration,
|
|
47
|
+
shadow || chatgpt.isDarkMode() ? '' : 'shadow' ); }
|
|
48
|
+
|
|
49
|
+
function alert(title = '', msg = '', btns = '', checkbox = '', width = '') {
|
|
50
|
+
return chatgpt.alert(`${ config.appSymbol } ${ title }`, msg, btns, checkbox, width );}
|
|
51
|
+
|
|
52
|
+
// Define SYNC function
|
|
53
|
+
|
|
54
|
+
syncExtension = () => {
|
|
55
|
+
settings.load('extensionDisabled').then(() => {
|
|
56
|
+
if (config.extensionDisabled) {
|
|
57
|
+
// remove your hacks
|
|
58
|
+
} else {
|
|
59
|
+
// sync each potentially updated setting passed to settings.load()
|
|
60
|
+
}});};
|
|
61
|
+
|
|
62
|
+
})();
|