@kudoai/chatgpt.js 2.6.7 → 2.6.8

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 +26 -24
  3. package/chatgpt.js +2056 -2060
  4. package/dist/chatgpt.min.js +3 -3
  5. package/docs/README.md +26 -24
  6. package/docs/SECURITY.md +25 -25
  7. package/docs/USERGUIDE.md +6 -6
  8. package/docs/de/LICENSE.md +29 -29
  9. package/docs/de/README.md +25 -23
  10. package/docs/de/SECURITY.md +25 -25
  11. package/docs/es/LICENSE.md +29 -29
  12. package/docs/es/README.md +25 -23
  13. package/docs/es/SECURITY.md +25 -25
  14. package/docs/fr/LICENSE.md +29 -29
  15. package/docs/fr/README.md +25 -23
  16. package/docs/fr/SECURITY.md +25 -25
  17. package/docs/hi/LICENSE.md +29 -29
  18. package/docs/hi/README.md +25 -23
  19. package/docs/hi/SECURITY.md +25 -25
  20. package/docs/it/LICENSE.md +26 -26
  21. package/docs/it/README.md +25 -23
  22. package/docs/it/SECURITY.md +25 -25
  23. package/docs/ja/LICENSE.md +29 -29
  24. package/docs/ja/README.md +25 -23
  25. package/docs/ja/SECURITY.md +25 -25
  26. package/docs/ko/LICENSE.md +32 -32
  27. package/docs/ko/README.md +25 -23
  28. package/docs/ko/SECURITY.md +25 -25
  29. package/docs/ne/LICENSE.md +35 -35
  30. package/docs/ne/README.md +25 -23
  31. package/docs/ne/SECURITY.md +25 -25
  32. package/docs/nl/LICENSE.md +29 -29
  33. package/docs/nl/README.md +25 -23
  34. package/docs/nl/SECURITY.md +25 -25
  35. package/docs/pt/LICENSE.md +28 -28
  36. package/docs/pt/README.md +25 -23
  37. package/docs/pt/SECURITY.md +25 -25
  38. package/docs/vi/LICENSE.md +29 -29
  39. package/docs/vi/README.md +25 -23
  40. package/docs/vi/SECURITY.md +25 -25
  41. package/docs/zh-cn/LICENSE.md +29 -29
  42. package/docs/zh-cn/README.md +25 -24
  43. package/docs/zh-cn/SECURITY.md +25 -25
  44. package/docs/zh-tw/LICENSE.md +29 -29
  45. package/docs/zh-tw/README.md +26 -24
  46. package/docs/zh-tw/SECURITY.md +25 -25
  47. package/package.json +73 -73
  48. package/starters/chrome/LICENSE.md +31 -43
  49. package/starters/chrome/docs/README.md +93 -93
  50. package/starters/chrome/docs/SECURITY.md +17 -17
  51. package/starters/chrome/docs/de/LICENSE.md +31 -31
  52. package/starters/chrome/docs/de/README.md +93 -93
  53. package/starters/chrome/docs/es/LICENSE.md +31 -31
  54. package/starters/chrome/docs/es/README.md +93 -93
  55. package/starters/chrome/docs/fr/LICENSE.md +31 -31
  56. package/starters/chrome/docs/fr/README.md +93 -93
  57. package/starters/chrome/docs/hi/LICENSE.md +31 -31
  58. package/starters/chrome/docs/hi/README.md +93 -93
  59. package/starters/chrome/docs/hi/SECURITY.md +17 -17
  60. package/starters/chrome/docs/it/LICENSE.md +29 -29
  61. package/starters/chrome/docs/it/README.md +93 -93
  62. package/starters/chrome/docs/ja/LICENSE.md +31 -31
  63. package/starters/chrome/docs/ja/README.md +93 -93
  64. package/starters/chrome/docs/ko/LICENSE.md +34 -34
  65. package/starters/chrome/docs/ko/README.md +93 -93
  66. package/starters/chrome/docs/nl/LICENSE.md +31 -30
  67. package/starters/chrome/docs/nl/README.md +93 -93
  68. package/starters/chrome/docs/pt/LICENSE.md +31 -31
  69. package/starters/chrome/docs/pt/README.md +93 -93
  70. package/starters/chrome/docs/vi/LICENSE.md +31 -31
  71. package/starters/chrome/docs/vi/README.md +93 -93
  72. package/starters/chrome/docs/zh-cn/LICENSE.md +31 -31
  73. package/starters/chrome/docs/zh-cn/README.md +93 -93
  74. package/starters/chrome/docs/zh-cn/SECURITY.md +17 -17
  75. package/starters/chrome/docs/zh-tw/LICENSE.md +31 -31
  76. package/starters/chrome/docs/zh-tw/README.md +93 -93
  77. package/starters/chrome/extension/background.js +14 -14
  78. package/starters/chrome/extension/content.js +62 -62
  79. package/starters/chrome/extension/lib/chatgpt.js +2057 -2061
  80. package/starters/chrome/extension/lib/settings-utils.js +24 -24
  81. package/starters/chrome/extension/manifest.json +24 -24
  82. package/starters/chrome/extension/popup/index.html +62 -62
  83. package/starters/chrome/extension/popup/popup.js +92 -92
  84. package/starters/chrome/extension/popup/style.css +55 -55
  85. package/starters/docs/LICENSE.md +13 -25
  86. package/starters/docs/README.md +29 -29
  87. package/starters/docs/de/LICENSE.md +13 -13
  88. package/starters/docs/de/README.md +29 -29
  89. package/starters/docs/es/LICENSE.md +13 -13
  90. package/starters/docs/es/README.md +29 -29
  91. package/starters/docs/fr/LICENSE.md +13 -13
  92. package/starters/docs/fr/README.md +29 -29
  93. package/starters/docs/hi/LICENSE.md +13 -13
  94. package/starters/docs/hi/README.md +29 -29
  95. package/starters/docs/it/LICENSE.md +11 -11
  96. package/starters/docs/it/README.md +29 -29
  97. package/starters/docs/ja/LICENSE.md +13 -13
  98. package/starters/docs/ja/README.md +30 -30
  99. package/starters/docs/ko/LICENSE.md +16 -16
  100. package/starters/docs/ko/README.md +29 -29
  101. package/starters/docs/nl/LICENSE.md +13 -13
  102. package/starters/docs/nl/README.md +29 -29
  103. package/starters/docs/pt/LICENSE.md +13 -13
  104. package/starters/docs/pt/README.md +29 -29
  105. package/starters/docs/vi/LICENSE.md +13 -13
  106. package/starters/docs/vi/README.md +29 -29
  107. package/starters/docs/zh-cn/LICENSE.md +13 -13
  108. package/starters/docs/zh-cn/README.md +30 -30
  109. package/starters/docs/zh-tw/LICENSE.md +13 -13
  110. package/starters/docs/zh-tw/README.md +29 -29
  111. package/starters/greasemonkey/LICENSE.md +31 -43
  112. package/starters/greasemonkey/chatgpt.js-greasemonkey-starter.user.js +5 -5
  113. package/starters/greasemonkey/docs/README.md +7 -7
  114. package/starters/greasemonkey/docs/SECURITY.md +17 -17
  115. package/starters/greasemonkey/docs/de/LICENSE.md +31 -31
  116. package/starters/greasemonkey/docs/es/LICENSE.md +31 -31
  117. package/starters/greasemonkey/docs/fr/LICENSE.md +31 -31
  118. package/starters/greasemonkey/docs/hi/LICENSE.md +31 -31
  119. package/starters/greasemonkey/docs/hi/SECURITY.md +17 -17
  120. package/starters/greasemonkey/docs/it/LICENSE.md +29 -29
  121. package/starters/greasemonkey/docs/ja/LICENSE.md +31 -31
  122. package/starters/greasemonkey/docs/ko/LICENSE.md +34 -34
  123. package/starters/greasemonkey/docs/nl/LICENSE.md +31 -30
  124. package/starters/greasemonkey/docs/pt/LICENSE.md +31 -31
  125. package/starters/greasemonkey/docs/vi/LICENSE.md +31 -31
  126. package/starters/greasemonkey/docs/zh-cn/LICENSE.md +31 -31
  127. package/starters/greasemonkey/docs/zh-cn/SECURITY.md +17 -17
  128. package/starters/greasemonkey/docs/zh-tw/LICENSE.md +31 -31
  129. package/LICENSE +0 -21
@@ -1,24 +1,24 @@
1
- const config = {
2
- prefix: 'chatgptJS', appSymbol: '🤖', appName: 'ChatGPT Extension',
3
- ghRepoURL: 'https://github.kudoai.com/chatgpt.js-chrome-starter' };
4
-
5
- const settings = {
6
-
7
- load: function() {
8
- const keys = ( // original array if array, else new array from multiple args
9
- Array.isArray(arguments[0]) ? arguments[0] : Array.from(arguments));
10
- return Promise.all(keys.map((key) => { // resolve promise when all keys load
11
- return new Promise((resolve) => { // resolve promise when single key value loads
12
- chrome.storage.local.get(config.prefix + '_' + key, (result) => { // load from Chrome
13
- config[key] = result[config.prefix + '_' + key] || false; resolve();
14
- });});}));},
15
-
16
- save: function(key, value) {
17
- const obj = {} ; obj[config.prefix + '_' + key] = value;
18
- chrome.storage.local.set(obj); // save to Chrome
19
- config[key] = value; // save to memory
20
- }
21
-
22
- };
23
-
24
- export { config, settings };
1
+ const config = {
2
+ prefix: 'chatgptJS', appSymbol: '🤖', appName: 'ChatGPT Extension',
3
+ ghRepoURL: 'https://github.kudoai.com/chatgpt.js-chrome-starter' };
4
+
5
+ const settings = {
6
+
7
+ load: function() {
8
+ const keys = ( // original array if array, else new array from multiple args
9
+ Array.isArray(arguments[0]) ? arguments[0] : Array.from(arguments));
10
+ return Promise.all(keys.map((key) => { // resolve promise when all keys load
11
+ return new Promise((resolve) => { // resolve promise when single key value loads
12
+ chrome.storage.local.get(config.prefix + '_' + key, (result) => { // load from Chrome
13
+ config[key] = result[config.prefix + '_' + key] || false; resolve();
14
+ });});}));},
15
+
16
+ save: function(key, value) {
17
+ const obj = {} ; obj[config.prefix + '_' + key] = value;
18
+ chrome.storage.local.set(obj); // save to Chrome
19
+ config[key] = value; // save to memory
20
+ }
21
+
22
+ };
23
+
24
+ export { config, settings };
@@ -1,24 +1,24 @@
1
- {
2
- "manifest_version": 3,
3
- "name": "ChatGPT Extension",
4
- "description": "A Chrome template to start using chatgpt.js like a boss!",
5
- "version": "2024.3.5",
6
- "author": "chatgpt.js",
7
- "icons": {
8
- "16": "icons/icon16.png",
9
- "32": "icons/icon32.png",
10
- "64": "icons/icon64.png",
11
- "128": "icons/icon128.png"
12
- },
13
- "permissions": [ "storage", "tabs" ],
14
- "action": { "default_popup": "popup/index.html" },
15
- "web_accessible_resources": [{
16
- "matches": ["<all_urls>"],
17
- "resources": ["lib/settings-utils.js", "lib/chatgpt.js"]
18
- }],
19
- "content_scripts": [{
20
- "matches": ["https://chat.openai.com/*"],
21
- "js": ["content.js"]
22
- }],
23
- "background": { "service_worker": "background.js" }
24
- }
1
+ {
2
+ "manifest_version": 3,
3
+ "name": "ChatGPT Extension",
4
+ "description": "A Chrome template to start using chatgpt.js like a boss!",
5
+ "version": "2024.4.5",
6
+ "author": "chatgpt.js",
7
+ "icons": {
8
+ "16": "icons/icon16.png",
9
+ "32": "icons/icon32.png",
10
+ "64": "icons/icon64.png",
11
+ "128": "icons/icon128.png"
12
+ },
13
+ "permissions": [ "storage", "tabs" ],
14
+ "action": { "default_popup": "popup/index.html" },
15
+ "web_accessible_resources": [{
16
+ "matches": ["<all_urls>"],
17
+ "resources": ["lib/settings-utils.js", "lib/chatgpt.js"]
18
+ }],
19
+ "content_scripts": [{
20
+ "matches": ["https://chat.openai.com/*"],
21
+ "js": ["content.js"]
22
+ }],
23
+ "background": { "service_worker": "background.js" }
24
+ }
@@ -1,62 +1,62 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <link href="/popup/style.css" rel="stylesheet">
5
- </head>
6
- <body>
7
- <div class="menu-header">
8
- <div class="logo">
9
- <img width=26 src="https://raw.githubusercontent.com/kudoai/chatgpt.js-chrome-starter/main/extension/icons/icon32.png">
10
- </div>
11
- <div class="menu-title">ChatGPT Extension</div>
12
- <div class="main-toggle">
13
- <label class="toggle-switch menu-area menu-icon">
14
- <input type="checkbox">
15
- <span class="slider"></span>
16
- </label>
17
- </div>
18
- </div>
19
- <!-- Sub-menu items
20
- <div class="menu">
21
- <div class="menu-item menu-area">
22
- <label class="toggle-switch menu-icon">
23
- <input type="checkbox">
24
- <span class="slider"></span>
25
- </label>
26
- <span >Toggle Label 1</span>
27
- </div>
28
- <div class="menu-item menu-area">
29
- <label class="toggle-switch menu-icon">
30
- <input type="checkbox">
31
- <span class="slider"></span>
32
- </label>
33
- <span >Toggle Label 2</span>
34
- </div>
35
- <div class="menu-item menu-area">
36
- <label class="toggle-switch menu-icon">
37
- <input type="checkbox">
38
- <span class="slider"></span>
39
- </label>
40
- <span >Toggle Label 3</span>
41
- </div>
42
- </div>
43
- -->
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://raw.githubusercontent.com/kudoai/chatgpt.js/main/media/images/badges/powered-by-chatgpt.js-faded.png"></a></div>
46
- <span title="Check for Updates" class="menu-icon menu-area" style="right:58px ; padding-top: 7px" >
47
- <img width=15 height=15 src="https://i.imgur.com/Luxs8j5.png" style="margin-top: 0.04rem">
48
- </span>
49
- <span title="Support" class="menu-icon menu-area" style="right:30px ; padding-top: 9px " >
50
- <a title="Support" href="https://github.com/KudoAI/chatgpt.js-chrome-starter/issues" target="_blank" rel="noopener">
51
- <img width=15 height=13 src="https://i.imgur.com/py0EeKw.png" style="margin-bottom: 0.04rem">
52
- </a>
53
- </span>
54
- <span title="More ChatGPT add-ons" class="menu-icon menu-area" style="right:2px ; padding-top: 7px " >
55
- <a title="More ChatGPT add-ons" href="https://github.com/adamlui/chatgpt-userscripts" target="_blank" rel="noopener">
56
- <svg width=16 height=16 viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M899.901 600.38H600.728v299.173c0 74.383-179.503 74.383-179.503 0V600.38H122.051c-74.384 0-74.384-179.503 0-179.503h299.173V121.703c0-74.384 179.503-74.384 179.503 0v299.174H899.9c74.385 0 74.385 179.503.001 179.503z"/></svg>
57
- </a>
58
- </span>
59
- </footer>
60
- <script src="popup.js"></script>
61
- </body>
62
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <link href="/popup/style.css" rel="stylesheet">
5
+ </head>
6
+ <body>
7
+ <div class="menu-header">
8
+ <div class="logo">
9
+ <img width=26 src="https://raw.githubusercontent.com/KudoAI/chatgpt.js-chrome-starter/main/extension/icons/icon32.png">
10
+ </div>
11
+ <div class="menu-title">ChatGPT Extension</div>
12
+ <div class="main-toggle">
13
+ <label class="toggle-switch menu-area menu-icon">
14
+ <input type="checkbox">
15
+ <span class="slider"></span>
16
+ </label>
17
+ </div>
18
+ </div>
19
+ <!-- Sub-menu items
20
+ <div class="menu">
21
+ <div class="menu-item menu-area">
22
+ <label class="toggle-switch menu-icon">
23
+ <input type="checkbox">
24
+ <span class="slider"></span>
25
+ </label>
26
+ <span >Toggle Label 1</span>
27
+ </div>
28
+ <div class="menu-item menu-area">
29
+ <label class="toggle-switch menu-icon">
30
+ <input type="checkbox">
31
+ <span class="slider"></span>
32
+ </label>
33
+ <span >Toggle Label 2</span>
34
+ </div>
35
+ <div class="menu-item menu-area">
36
+ <label class="toggle-switch menu-icon">
37
+ <input type="checkbox">
38
+ <span class="slider"></span>
39
+ </label>
40
+ <span >Toggle Label 3</span>
41
+ </div>
42
+ </div>
43
+ -->
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://raw.githubusercontent.com/KudoAI/chatgpt.js/main/media/images/badges/powered-by-chatgpt.js-faded.png"></a></div>
46
+ <span title="Check for Updates" class="menu-icon menu-area" style="right:58px ; padding-top: 7px" >
47
+ <img width=15 height=15 src="https://i.imgur.com/Luxs8j5.png" style="margin-top: 0.04rem">
48
+ </span>
49
+ <span title="Support" class="menu-icon menu-area" style="right:30px ; padding-top: 9px " >
50
+ <a title="Support" href="https://github.com/KudoAI/chatgpt.js-chrome-starter/issues" target="_blank" rel="noopener">
51
+ <img width=15 height=13 src="https://i.imgur.com/py0EeKw.png" style="margin-bottom: 0.04rem">
52
+ </a>
53
+ </span>
54
+ <span title="More ChatGPT add-ons" class="menu-icon menu-area" style="right:2px ; padding-top: 7px " >
55
+ <a title="More ChatGPT add-ons" href="https://github.com/adamlui/chatgpt-userscripts" target="_blank" rel="noopener">
56
+ <svg width=16 height=16 viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M899.901 600.38H600.728v299.173c0 74.383-179.503 74.383-179.503 0V600.38H122.051c-74.384 0-74.384-179.503 0-179.503h299.173V121.703c0-74.384 179.503-74.384 179.503 0v299.174H899.9c74.385 0 74.385 179.503.001 179.503z"/></svg>
57
+ </a>
58
+ </span>
59
+ </footer>
60
+ <script src="popup.js"></script>
61
+ </body>
62
+ </html>
@@ -1,92 +1,92 @@
1
- (async () => {
2
-
3
- // Import settings-utils.js
4
- const { config, settings } = await import(chrome.runtime.getURL('lib/settings-utils.js'));
5
-
6
- // Initialize popup toggles
7
- settings.load('extensionDisabled')
8
- .then(function() { // restore extension/toggle states
9
- masterToggle.checked = !config.extensionDisabled;
10
- updateGreyness();
11
- });
12
-
13
- // Add main toggle click-listener
14
- const toggles = document.querySelectorAll('input'),
15
- masterToggle = toggles[0];
16
- masterToggle.addEventListener('change', function() {
17
- settings.save('extensionDisabled', !this.checked);
18
- syncExtension() ; updateGreyness();
19
- notify(config.appName + ( this.checked ? ' ON' : ' OFF' ));
20
- });
21
-
22
- // Add update-check span click-listener
23
- const updateSpan = document.querySelector('span[title*="update" i]');
24
- updateSpan.addEventListener('click', () => {
25
- window.close(); // popup
26
- chrome.runtime.requestUpdateCheck((status, details) => {
27
- alertToUpdate(status === 'update_available' ? details.version : '');
28
- });});
29
-
30
- // Add Support span click-listener
31
- const supportLink = document.querySelector('a[title*="support" i]'),
32
- supportSpan = supportLink.parentNode;
33
- supportSpan.addEventListener('click', (event) => {
34
- if (event.target == supportSpan) supportLink.click(); // to avoid double-toggle
35
- });
36
-
37
- // Add More Add-ons span click-listener
38
- const moreAddOnsLink = document.querySelector('a[title*="more" i]'),
39
- moreAddOnsSpan = moreAddOnsLink.parentNode;
40
- moreAddOnsSpan.addEventListener('click', (event) => {
41
- if (event.target == moreAddOnsSpan) moreAddOnsLink.click(); // to avoid double-toggle
42
- });
43
-
44
- // Add Powered by chatgpt.js hover-listener
45
- const chatGPTjsHostPath = 'https://raw.githubusercontent.com/kudoai/chatgpt.js/main/media/images/badges/',
46
- chatGPTjsImg = document.querySelector('.chatgpt-js img');
47
- chatGPTjsImg.addEventListener('mouseover', () => {
48
- chatGPTjsImg.src = chatGPTjsHostPath + 'powered-by-chatgpt.js.png'; });
49
- chatGPTjsImg.addEventListener('mouseout', () => {
50
- chatGPTjsImg.src = chatGPTjsHostPath + 'powered-by-chatgpt.js-faded.png'; });
51
-
52
- // Define FEEDBACK functions
53
-
54
- function notify(msg, position) {
55
- chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
56
- chrome.tabs.sendMessage(tabs[0].id, {
57
- action: 'notify', msg: msg, position: position || 'bottom-right' });
58
- });}
59
-
60
- function alertToUpdate(version) {
61
- chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
62
- chrome.tabs.sendMessage(tabs[0].id, {
63
- action: 'alertToUpdate', args: version });
64
- });}
65
-
66
- // Define SYNC functions
67
-
68
- function syncExtension() {
69
- chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
70
- chrome.tabs.sendMessage(tabs[0].id, { action: 'syncExtension' });
71
- });}
72
-
73
- function updateGreyness() {
74
-
75
- // Updated toolbar icon
76
- const iconDimensions = [16, 32, 64, 128], iconPaths = {};
77
- iconDimensions.forEach((dimension) => {
78
- iconPaths[dimension] = '../icons/'
79
- + (config.extensionDisabled ? 'faded/' : '')
80
- + 'icon' + dimension + '.png';
81
- });
82
- chrome.action.setIcon({ path: iconPaths });
83
-
84
- // Update menu contents
85
- document.querySelectorAll('div.logo, div.menu-title, div.menu')
86
- .forEach((elem) => {
87
- elem.classList.remove(masterToggle.checked ? 'disabled' : 'enabled');
88
- elem.classList.add(masterToggle.checked ? 'enabled' : 'disabled');
89
- });
90
- }
91
-
92
- })();
1
+ (async () => {
2
+
3
+ // Import settings-utils.js
4
+ const { config, settings } = await import(chrome.runtime.getURL('lib/settings-utils.js'));
5
+
6
+ // Initialize popup toggles
7
+ settings.load('extensionDisabled')
8
+ .then(function() { // restore extension/toggle states
9
+ masterToggle.checked = !config.extensionDisabled;
10
+ updateGreyness();
11
+ });
12
+
13
+ // Add main toggle click-listener
14
+ const toggles = document.querySelectorAll('input'),
15
+ masterToggle = toggles[0];
16
+ masterToggle.addEventListener('change', function() {
17
+ settings.save('extensionDisabled', !this.checked);
18
+ syncExtension() ; updateGreyness();
19
+ notify(config.appName + ( this.checked ? ' ON' : ' OFF' ));
20
+ });
21
+
22
+ // Add update-check span click-listener
23
+ const updateSpan = document.querySelector('span[title*="update" i]');
24
+ updateSpan.addEventListener('click', () => {
25
+ window.close(); // popup
26
+ chrome.runtime.requestUpdateCheck((status, details) => {
27
+ alertToUpdate(status === 'update_available' ? details.version : '');
28
+ });});
29
+
30
+ // Add Support span click-listener
31
+ const supportLink = document.querySelector('a[title*="support" i]'),
32
+ supportSpan = supportLink.parentNode;
33
+ supportSpan.addEventListener('click', (event) => {
34
+ if (event.target == supportSpan) supportLink.click(); // to avoid double-toggle
35
+ });
36
+
37
+ // Add More Add-ons span click-listener
38
+ const moreAddOnsLink = document.querySelector('a[title*="more" i]'),
39
+ moreAddOnsSpan = moreAddOnsLink.parentNode;
40
+ moreAddOnsSpan.addEventListener('click', (event) => {
41
+ if (event.target == moreAddOnsSpan) moreAddOnsLink.click(); // to avoid double-toggle
42
+ });
43
+
44
+ // Add Powered by chatgpt.js hover-listener
45
+ const chatGPTjsHostPath = 'https://raw.githubusercontent.com/KudoAI/chatgpt.js/main/media/images/badges/',
46
+ chatGPTjsImg = document.querySelector('.chatgpt-js img');
47
+ chatGPTjsImg.addEventListener('mouseover', () => {
48
+ chatGPTjsImg.src = chatGPTjsHostPath + 'powered-by-chatgpt.js.png'; });
49
+ chatGPTjsImg.addEventListener('mouseout', () => {
50
+ chatGPTjsImg.src = chatGPTjsHostPath + 'powered-by-chatgpt.js-faded.png'; });
51
+
52
+ // Define FEEDBACK functions
53
+
54
+ function notify(msg, position) {
55
+ chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
56
+ chrome.tabs.sendMessage(tabs[0].id, {
57
+ action: 'notify', msg: msg, position: position || 'bottom-right' });
58
+ });}
59
+
60
+ function alertToUpdate(version) {
61
+ chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
62
+ chrome.tabs.sendMessage(tabs[0].id, {
63
+ action: 'alertToUpdate', args: version });
64
+ });}
65
+
66
+ // Define SYNC functions
67
+
68
+ function syncExtension() {
69
+ chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
70
+ chrome.tabs.sendMessage(tabs[0].id, { action: 'syncExtension' });
71
+ });}
72
+
73
+ function updateGreyness() {
74
+
75
+ // Updated toolbar icon
76
+ const iconDimensions = [16, 32, 64, 128], iconPaths = {};
77
+ iconDimensions.forEach((dimension) => {
78
+ iconPaths[dimension] = '../icons/'
79
+ + (config.extensionDisabled ? 'faded/' : '')
80
+ + 'icon' + dimension + '.png';
81
+ });
82
+ chrome.action.setIcon({ path: iconPaths });
83
+
84
+ // Update menu contents
85
+ document.querySelectorAll('div.logo, div.menu-title, div.menu')
86
+ .forEach((elem) => {
87
+ elem.classList.remove(masterToggle.checked ? 'disabled' : 'enabled');
88
+ elem.classList.add(masterToggle.checked ? 'enabled' : 'disabled');
89
+ });
90
+ }
91
+
92
+ })();
@@ -1,55 +1,55 @@
1
- /* General size */
2
- html { height: fit-content }
3
- body { width: 265px ; height: 85px !important ; margin: 0 }
4
-
5
- /* General font */
6
- body, button, input, select, textarea {
7
- font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",sans-serif ;
8
- font-size: .905rem ; user-select: none
9
- }
10
- a { color: #999 ; text-decoration: none }
11
- a:focus, a:hover { text-decoration: underline ; color: inherit }
12
-
13
- /* Header */
14
- .menu-header {
15
- border-bottom: solid 1px lightgrey ; padding: 5px 5px 5px 0; margin: 0 ;
16
- display: flex; background: white ; align-items: center }
17
- .logo { margin: 4px 10px 4px 12px }
18
- .menu-title { font-size: 0.85rem ; font-weight: 600 }
19
- .menu-icons > .toggle-switch { transform: scale(1.1) } /* make master toggle bigger */
20
- .main-toggle { margin-left: auto ; display: flex }
21
-
22
- /* Menu item elements */
23
- .menu-item {
24
- position: relative ; align-items: center ; border-bottom: 1px solid lightgrey ;
25
- display: flex ; min-height: 2rem ; padding-right: 14px ; white-space: nowrap ; font-size: 91%
26
- }
27
- .menu-icon { padding: 8px }
28
- .menu-area:focus, .menu-area:hover { /* add hover color/cursor */
29
- color: var(--bg) ; background: rgb(100, 149, 237) ; cursor: pointer }
30
- .menu-item:hover .toggle-switch .slider, .menu-item:hover span { filter: invert(1) } /* invert toggle switch + label */
31
- .menu-item:hover .menu-icon { filter: none } /* ...but not non-toggle icons */
32
- .menu-item > label > .slider { transform: scale(0.95) ; top: 1px } /* make child toggles smaller */
33
- .menu-prompt { margin-left: 2px } /* align non-toggle items */
34
-
35
- /* Toggle elements */
36
- .toggle-switch input[type="checkbox"] { display: none } /* hide checkbox from toggles */
37
- .toggle-switch .slider { /* style sliders */
38
- background-color: white; display: block; border: 1px solid black; border-radius: 7px ;
39
- position: relative ; top: 0.05rem ; height: 10px ; width: 18px ; cursor: pointer ;
40
- }
41
- .toggle-switch .slider::before { /* style slider knobs */
42
- position: absolute ; height: 0.625rem ; width: 0.625rem ; left: -0.04rem ; top: -0.05rem ;
43
- border: 1px solid black ; border-radius: 50% ; background-color: white ; content: ""
44
- }
45
- .toggle-switch input[type="checkbox"]:checked + .slider { background-color: black } /* color active slider */
46
- .toggle-switch input[type="checkbox"]:checked + .slider::before { transform: translateX(9px) } /* move knob right when toggled */
47
-
48
- /* Footer */
49
- footer { font-size: 12px ; text-align: center ; color: #999 ; background: #f5f5f5 ; height: 40px ; padding-top: 3px }
50
- footer > .menu-icon { position: absolute ; bottom: 4px ; opacity: 0.7 }
51
- .chatgpt-js { position: absolute ; bottom: 0.65rem ; left: 0.7rem }
52
-
53
- /* Master toggle effects */
54
- .disabled { opacity: 0.3 ; pointer-events: none }
55
- .enabled { opacity: 1 }
1
+ /* General size */
2
+ html { height: fit-content }
3
+ body { width: 265px ; height: 85px !important ; margin: 0 }
4
+
5
+ /* General font */
6
+ body, button, input, select, textarea {
7
+ font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",sans-serif ;
8
+ font-size: .905rem ; user-select: none
9
+ }
10
+ a { color: #999 ; text-decoration: none }
11
+ a:focus, a:hover { text-decoration: underline ; color: inherit }
12
+
13
+ /* Header */
14
+ .menu-header {
15
+ border-bottom: solid 1px lightgrey ; padding: 5px 5px 5px 0; margin: 0 ;
16
+ display: flex; background: white ; align-items: center }
17
+ .logo { margin: 4px 10px 4px 12px }
18
+ .menu-title { font-size: 0.85rem ; font-weight: 600 }
19
+ .menu-icons > .toggle-switch { transform: scale(1.1) } /* make master toggle bigger */
20
+ .main-toggle { margin-left: auto ; display: flex }
21
+
22
+ /* Menu item elements */
23
+ .menu-item {
24
+ position: relative ; align-items: center ; border-bottom: 1px solid lightgrey ;
25
+ display: flex ; min-height: 2rem ; padding-right: 14px ; white-space: nowrap ; font-size: 91%
26
+ }
27
+ .menu-icon { padding: 8px }
28
+ .menu-area:focus, .menu-area:hover { /* add hover color/cursor */
29
+ color: var(--bg) ; background: rgb(100, 149, 237) ; cursor: pointer }
30
+ .menu-item:hover .toggle-switch .slider, .menu-item:hover span { filter: invert(1) } /* invert toggle switch + label */
31
+ .menu-item:hover .menu-icon { filter: none } /* ...but not non-toggle icons */
32
+ .menu-item > label > .slider { transform: scale(0.95) ; top: 1px } /* make child toggles smaller */
33
+ .menu-prompt { margin-left: 2px } /* align non-toggle items */
34
+
35
+ /* Toggle elements */
36
+ .toggle-switch input[type="checkbox"] { display: none } /* hide checkbox from toggles */
37
+ .toggle-switch .slider { /* style sliders */
38
+ background-color: white; display: block; border: 1px solid black; border-radius: 7px ;
39
+ position: relative ; top: 0.05rem ; height: 10px ; width: 18px ; cursor: pointer ;
40
+ }
41
+ .toggle-switch .slider::before { /* style slider knobs */
42
+ position: absolute ; height: 0.625rem ; width: 0.625rem ; left: -0.04rem ; top: -0.05rem ;
43
+ border: 1px solid black ; border-radius: 50% ; background-color: white ; content: ""
44
+ }
45
+ .toggle-switch input[type="checkbox"]:checked + .slider { background-color: black } /* color active slider */
46
+ .toggle-switch input[type="checkbox"]:checked + .slider::before { transform: translateX(9px) } /* move knob right when toggled */
47
+
48
+ /* Footer */
49
+ footer { font-size: 12px ; text-align: center ; color: #999 ; background: #f5f5f5 ; height: 40px ; padding-top: 3px }
50
+ footer > .menu-icon { position: absolute ; bottom: 4px ; opacity: 0.7 }
51
+ .chatgpt-js { position: absolute ; bottom: 0.65rem ; left: 0.7rem }
52
+
53
+ /* Master toggle effects */
54
+ .disabled { opacity: 0.3 ; pointer-events: none }
55
+ .enabled { opacity: 1 }
@@ -1,25 +1,13 @@
1
- <div align="center">
2
- <h6><a href="./"><img height=15 style="margin: 0 3px -2px" src="https://raw.githubusercontent.com/kudoai/chatgpt.js/6fa1659feadaf70853996dc7d7f6e1ab5a1e6301/media/images/icons/earth-americas.svg"></a> English | <a href="zh-cn/LICENSE.md">简体中文</a> | <a href="zh-tw/LICENSE.md">繁體中文</a> | <a href="ja/LICENSE.md">日本</a> | <a href="ko/LICENSE.md">한국인</a> | <a href="hi/LICENSE.md">हिंदी</a> | <a href="de/LICENSE.md">Deutsch</a> | <a href="es/LICENSE.md">Español</a> | <a href="fr/LICENSE.md">Français</a> | <a href="it/LICENSE.md">Italiano</a> | <a href="nl/LICENSE.md">Nederlands</a> | <a href="pt/LICENSE.md">Português</a> | <a href="vi/LICENSE.md">Việt</a></h6>
3
- </div>
4
-
5
- # MIT License
6
-
7
- Copyright (c) 2023–2024 [KudoAI](https://github.com/KudoAI) & contributors
8
-
9
- Permission is hereby granted, free of charge, to any person obtaining a copy
10
- of this software and associated documentation files (the "Software"), to deal
11
- in the Software without restriction, including without limitation the rights
12
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- copies of the Software, and to permit persons to whom the Software is
14
- furnished to do so, subject to the following conditions:
15
-
16
- The above copyright notice and this permission notice shall be included in all
17
- copies or substantial portions of the Software.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
- SOFTWARE.
1
+ <div align="center">
2
+ <h6><a href="./"><img height=15 style="margin: 0 3px -2px" src="https://raw.githubusercontent.com/KudoAI/chatgpt.js/6fa1659feadaf70853996dc7d7f6e1ab5a1e6301/media/images/icons/earth-americas.svg"></a> English | <a href="zh-cn/LICENSE.md">简体中文</a> | <a href="zh-tw/LICENSE.md">繁體中文</a> | <a href="ja/LICENSE.md">日本</a> | <a href="ko/LICENSE.md">한국인</a> | <a href="hi/LICENSE.md">हिंदी</a> | <a href="de/LICENSE.md">Deutsch</a> | <a href="es/LICENSE.md">Español</a> | <a href="fr/LICENSE.md">Français</a> | <a href="it/LICENSE.md">Italiano</a> | <a href="nl/LICENSE.md">Nederlands</a> | <a href="pt/LICENSE.md">Português</a> | <a href="vi/LICENSE.md">Việt</a></h6>
3
+ </div>
4
+
5
+ # MIT License
6
+
7
+ Copyright © 2023–2024 [KudoAI](https://github.com/KudoAI) & contributors
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,29 +1,29 @@
1
- <div align="center">
2
- <h6>
3
- <a href="https://github.com/KudoAI/chatgpt.js/tree/main/starters/docs"><img height=15 style="margin: 0 3px -2px" src="https://raw.githubusercontent.com/kudoai/chatgpt.js/0fc3060273fcff77d3e2ff968d5c74acdab62beb/media/images/icons/earth-americas-icon32.svg"></a> English | <a href="zh-cn#readme">简体中文</a> | <a href="zh-tw#readme">繁體中文</a> | <a href="ja#readme">日本</a> | <a href="ko#readme">한국인</a> | <a href="hi#readme">हिंदी</a> | <a href="de#readme">Deutsch</a> | <a href="es#readme">Español</a> | <a href="fr#readme">Français</a> | <a href="it#readme">Italiano</a> | <a href="nl#readme">Nederlands</a> | <a href="pt#readme">Português</a> | <a href="vi#readme">Việt</a>
4
- </h6>
5
- </div>
6
-
7
- # 🚀 chatgpt.js/starters
8
-
9
- ### Starter templates to develop for various platforms using <a href="https://github.com/KudoAI/chatgpt.js">chatgpt.js</a>
10
-
11
- <br>
12
-
13
- <img src="../chrome/media/images/screenshots/extension-loaded.png">
14
-
15
- <h2><a href="../chrome"><img style="margin: 0 2px -1px 0" height=18 src="https://www.google.com/chrome/static/images/favicons/apple-icon-60x60.png"></a> <a href="../chrome">Chrome starter</a></h2>
16
-
17
- Template for creating a Chrome extension using chatgpt.js (including pop-up menu + settings management)
18
-
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
-
21
- <h2><a href="../greasemonkey"><img style="margin: 0 2px -0.065rem 0" height=19 src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/starters/media/images/icons/tampermonkey-icon28.png"><img style="margin: 0 2px -0.035rem 1px" height=19.5 src="https://raw.githubusercontent.com/kudoai/chatgpt.js/main/starters/media/images/icons/violentmonkey-icon100.png"></a> <a href="../greasemonkey">Greasemonkey starter</a></h2>
22
-
23
- Template for creating a Greasemonkey userscript using chatgpt.js
24
-
25
- [Repo](https://github.com/KudoAI/chatgpt.js-greasemonkey-starter) / [Readme](../greasemonkey#readme) / [Get help](https://github.com/KudoAI/chatgpt.js-greasemonkey-starter/issues)
26
-
27
- #
28
-
29
- [Back to top ↑](#)
1
+ <div align="center">
2
+ <h6>
3
+ <a href="https://github.com/KudoAI/chatgpt.js/tree/main/starters/docs"><img height=15 style="margin: 0 3px -2px" src="https://raw.githubusercontent.com/KudoAI/chatgpt.js/0fc3060273fcff77d3e2ff968d5c74acdab62beb/media/images/icons/earth-americas-icon32.svg"></a> English | <a href="zh-cn#readme">简体中文</a> | <a href="zh-tw#readme">繁體中文</a> | <a href="ja#readme">日本</a> | <a href="ko#readme">한국인</a> | <a href="hi#readme">हिंदी</a> | <a href="de#readme">Deutsch</a> | <a href="es#readme">Español</a> | <a href="fr#readme">Français</a> | <a href="it#readme">Italiano</a> | <a href="nl#readme">Nederlands</a> | <a href="pt#readme">Português</a> | <a href="vi#readme">Việt</a>
4
+ </h6>
5
+ </div>
6
+
7
+ # 🚀 chatgpt.js/starters
8
+
9
+ ### Starter templates to develop for various platforms using <a href="https://github.com/KudoAI/chatgpt.js">chatgpt.js</a>
10
+
11
+ <br>
12
+
13
+ <img src="../chrome/media/images/screenshots/extension-loaded.png">
14
+
15
+ <h2><a href="../chrome"><img style="margin: 0 2px -1px 0" height=18 src="https://www.google.com/chrome/static/images/favicons/apple-icon-60x60.png"></a> <a href="../chrome">Chrome starter</a></h2>
16
+
17
+ Template for creating a Chrome extension using chatgpt.js (including pop-up menu + settings management)
18
+
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
+
21
+ <h2><a href="../greasemonkey"><img style="margin: 0 2px -0.065rem 0" height=19 src="https://raw.githubusercontent.com/KudoAI/chatgpt.js/main/starters/media/images/icons/tampermonkey-icon28.png"><img style="margin: 0 2px -0.035rem 1px" height=19.5 src="https://raw.githubusercontent.com/KudoAI/chatgpt.js/main/starters/media/images/icons/violentmonkey-icon100.png"></a> <a href="../greasemonkey">Greasemonkey starter</a></h2>
22
+
23
+ Template for creating a Greasemonkey userscript using chatgpt.js
24
+
25
+ [Repo](https://github.com/KudoAI/chatgpt.js-greasemonkey-starter) / [Readme](../greasemonkey#readme) / [Get help](https://github.com/KudoAI/chatgpt.js-greasemonkey-starter/issues)
26
+
27
+ #
28
+
29
+ [Back to top ↑](#)