@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.
Files changed (129) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +30 -34
  3. package/chatgpt.js +2001 -2060
  4. package/dist/chatgpt.min.js +9 -3
  5. package/docs/README.md +30 -34
  6. package/docs/SECURITY.md +25 -25
  7. package/docs/USERGUIDE.md +6 -65
  8. package/package.json +73 -73
  9. package/starters/chrome/LICENSE.md +31 -43
  10. package/starters/chrome/docs/README.md +93 -93
  11. package/starters/chrome/docs/SECURITY.md +17 -17
  12. package/starters/chrome/extension/background.js +14 -14
  13. package/starters/chrome/extension/content.js +62 -62
  14. package/starters/chrome/extension/lib/chatgpt.js +2002 -2061
  15. package/starters/chrome/extension/lib/settings-utils.js +24 -24
  16. package/starters/chrome/extension/manifest.json +24 -24
  17. package/starters/chrome/extension/popup/index.html +62 -62
  18. package/starters/chrome/extension/popup/popup.js +92 -92
  19. package/starters/chrome/extension/popup/style.css +55 -55
  20. package/starters/docs/LICENSE.md +13 -25
  21. package/starters/docs/README.md +29 -29
  22. package/starters/greasemonkey/LICENSE.md +31 -43
  23. package/starters/greasemonkey/chatgpt.js-greasemonkey-starter.user.js +5 -5
  24. package/starters/greasemonkey/docs/README.md +7 -7
  25. package/starters/greasemonkey/docs/SECURITY.md +17 -17
  26. package/LICENSE +0 -21
  27. package/docs/de/LICENSE.md +0 -29
  28. package/docs/de/README.md +0 -343
  29. package/docs/de/SECURITY.md +0 -25
  30. package/docs/es/LICENSE.md +0 -29
  31. package/docs/es/README.md +0 -343
  32. package/docs/es/SECURITY.md +0 -25
  33. package/docs/fr/LICENSE.md +0 -29
  34. package/docs/fr/README.md +0 -343
  35. package/docs/fr/SECURITY.md +0 -25
  36. package/docs/hi/LICENSE.md +0 -29
  37. package/docs/hi/README.md +0 -344
  38. package/docs/hi/SECURITY.md +0 -25
  39. package/docs/it/LICENSE.md +0 -27
  40. package/docs/it/README.md +0 -343
  41. package/docs/it/SECURITY.md +0 -25
  42. package/docs/ja/LICENSE.md +0 -29
  43. package/docs/ja/README.md +0 -343
  44. package/docs/ja/SECURITY.md +0 -25
  45. package/docs/ko/LICENSE.md +0 -32
  46. package/docs/ko/README.md +0 -348
  47. package/docs/ko/SECURITY.md +0 -25
  48. package/docs/ne/LICENSE.md +0 -35
  49. package/docs/ne/README.md +0 -344
  50. package/docs/ne/SECURITY.md +0 -25
  51. package/docs/nl/LICENSE.md +0 -29
  52. package/docs/nl/README.md +0 -343
  53. package/docs/nl/SECURITY.md +0 -25
  54. package/docs/pt/LICENSE.md +0 -29
  55. package/docs/pt/README.md +0 -343
  56. package/docs/pt/SECURITY.md +0 -25
  57. package/docs/vi/LICENSE.md +0 -29
  58. package/docs/vi/README.md +0 -343
  59. package/docs/vi/SECURITY.md +0 -25
  60. package/docs/zh-cn/LICENSE.md +0 -29
  61. package/docs/zh-cn/README.md +0 -343
  62. package/docs/zh-cn/SECURITY.md +0 -25
  63. package/docs/zh-tw/LICENSE.md +0 -29
  64. package/docs/zh-tw/README.md +0 -342
  65. package/docs/zh-tw/SECURITY.md +0 -25
  66. package/starters/chrome/docs/de/LICENSE.md +0 -31
  67. package/starters/chrome/docs/de/README.md +0 -93
  68. package/starters/chrome/docs/es/LICENSE.md +0 -31
  69. package/starters/chrome/docs/es/README.md +0 -93
  70. package/starters/chrome/docs/fr/LICENSE.md +0 -31
  71. package/starters/chrome/docs/fr/README.md +0 -93
  72. package/starters/chrome/docs/hi/LICENSE.md +0 -31
  73. package/starters/chrome/docs/hi/README.md +0 -93
  74. package/starters/chrome/docs/hi/SECURITY.md +0 -17
  75. package/starters/chrome/docs/it/LICENSE.md +0 -29
  76. package/starters/chrome/docs/it/README.md +0 -93
  77. package/starters/chrome/docs/ja/LICENSE.md +0 -31
  78. package/starters/chrome/docs/ja/README.md +0 -93
  79. package/starters/chrome/docs/ko/LICENSE.md +0 -34
  80. package/starters/chrome/docs/ko/README.md +0 -93
  81. package/starters/chrome/docs/nl/LICENSE.md +0 -30
  82. package/starters/chrome/docs/nl/README.md +0 -93
  83. package/starters/chrome/docs/pt/LICENSE.md +0 -31
  84. package/starters/chrome/docs/pt/README.md +0 -93
  85. package/starters/chrome/docs/vi/LICENSE.md +0 -31
  86. package/starters/chrome/docs/vi/README.md +0 -93
  87. package/starters/chrome/docs/zh-cn/LICENSE.md +0 -31
  88. package/starters/chrome/docs/zh-cn/README.md +0 -93
  89. package/starters/chrome/docs/zh-cn/SECURITY.md +0 -17
  90. package/starters/chrome/docs/zh-tw/LICENSE.md +0 -31
  91. package/starters/chrome/docs/zh-tw/README.md +0 -93
  92. package/starters/docs/de/LICENSE.md +0 -13
  93. package/starters/docs/de/README.md +0 -29
  94. package/starters/docs/es/LICENSE.md +0 -13
  95. package/starters/docs/es/README.md +0 -29
  96. package/starters/docs/fr/LICENSE.md +0 -13
  97. package/starters/docs/fr/README.md +0 -29
  98. package/starters/docs/hi/LICENSE.md +0 -13
  99. package/starters/docs/hi/README.md +0 -29
  100. package/starters/docs/it/LICENSE.md +0 -11
  101. package/starters/docs/it/README.md +0 -29
  102. package/starters/docs/ja/LICENSE.md +0 -13
  103. package/starters/docs/ja/README.md +0 -30
  104. package/starters/docs/ko/LICENSE.md +0 -16
  105. package/starters/docs/ko/README.md +0 -29
  106. package/starters/docs/nl/LICENSE.md +0 -13
  107. package/starters/docs/nl/README.md +0 -29
  108. package/starters/docs/pt/LICENSE.md +0 -13
  109. package/starters/docs/pt/README.md +0 -29
  110. package/starters/docs/vi/LICENSE.md +0 -13
  111. package/starters/docs/vi/README.md +0 -29
  112. package/starters/docs/zh-cn/LICENSE.md +0 -13
  113. package/starters/docs/zh-cn/README.md +0 -30
  114. package/starters/docs/zh-tw/LICENSE.md +0 -13
  115. package/starters/docs/zh-tw/README.md +0 -29
  116. package/starters/greasemonkey/docs/de/LICENSE.md +0 -31
  117. package/starters/greasemonkey/docs/es/LICENSE.md +0 -31
  118. package/starters/greasemonkey/docs/fr/LICENSE.md +0 -31
  119. package/starters/greasemonkey/docs/hi/LICENSE.md +0 -31
  120. package/starters/greasemonkey/docs/hi/SECURITY.md +0 -17
  121. package/starters/greasemonkey/docs/it/LICENSE.md +0 -29
  122. package/starters/greasemonkey/docs/ja/LICENSE.md +0 -31
  123. package/starters/greasemonkey/docs/ko/LICENSE.md +0 -34
  124. package/starters/greasemonkey/docs/nl/LICENSE.md +0 -30
  125. package/starters/greasemonkey/docs/pt/LICENSE.md +0 -31
  126. package/starters/greasemonkey/docs/vi/LICENSE.md +0 -31
  127. package/starters/greasemonkey/docs/zh-cn/LICENSE.md +0 -31
  128. package/starters/greasemonkey/docs/zh-cn/SECURITY.md +0 -17
  129. 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
- // (c) 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
- })();
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
+ })();