@kudoai/chatgpt.js 3.7.0 → 3.7.1

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 CHANGED
@@ -49,8 +49,8 @@
49
49
  <img src="https://img.shields.io/github/stars/KudoAI/chatgpt.js?label=Stars&color=af68ff&logo=github&logoColor=white&labelColor=464646&style=for-the-badge"></a>
50
50
  <a href="https://github.com/KudoAI/chatgpt.js/blob/main/LICENSE.md">
51
51
  <img src="https://img.shields.io/badge/License-MIT-green.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
52
- <a href="https://github.com/KudoAI/chatgpt.js/tree/v3.7.0/dist/chatgpt.min.js">
53
- <img src="https://img.shields.io/github/size/KudoAI/chatgpt.js/dist/chatgpt.min.js?branch=v3.7.0&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
52
+ <a href="https://github.com/KudoAI/chatgpt.js/tree/v3.7.1/dist/chatgpt.min.js">
53
+ <img src="https://img.shields.io/github/size/KudoAI/chatgpt.js/dist/chatgpt.min.js?branch=v3.7.1&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
54
54
  <a href="https://www.codefactor.io/repository/github/kudoai/chatgpt.js">
55
55
  <img src="https://img.shields.io/codefactor/grade/github/kudoai/chatgpt.js?label=Code+Quality&logo=codefactor&logoColor=white&labelColor=464646&color=1acc6c&style=for-the-badge"></a>
56
56
  <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=kudoai_chatgpt.js">
@@ -111,7 +111,7 @@
111
111
 
112
112
  ```js
113
113
  (async () => {
114
- await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.0/dist/chatgpt.min.js');
114
+ await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.1/dist/chatgpt.min.js');
115
115
  // Your code here...
116
116
  })();
117
117
  ```
@@ -120,7 +120,7 @@
120
120
 
121
121
  ```js
122
122
  var xhr = new XMLHttpRequest();
123
- xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.0/dist/chatgpt.min.js');
123
+ xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.1/dist/chatgpt.min.js');
124
124
  xhr.onload = function () {
125
125
  if (xhr.status === 200) {
126
126
  var chatgptJS = document.createElement('script');
@@ -143,7 +143,7 @@ function yourCode() {
143
143
 
144
144
  ```js
145
145
  ...
146
- // @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.0/dist/chatgpt.min.js
146
+ // @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.1/dist/chatgpt.min.js
147
147
  // ==/UserScript==
148
148
 
149
149
  // Your code here...
@@ -213,7 +213,7 @@ chatgpt.get('reply', 'last');
213
213
 
214
214
  Each call equally fetches the last response. If you think it works, it probably will... so just type it!
215
215
 
216
- If it didn't, check out the extended [userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.7.0/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!
216
+ If it didn't, check out the extended [userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.7.1/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!
217
217
 
218
218
  <img height=8px width="100%" src="https://assets.chatgptjs.org/images/separators/gradient-aqua.png?v=e638eac">
219
219
 
@@ -451,7 +451,7 @@ This library exists thanks to code, translations, issues & ideas from the follow
451
451
  <div align="center">
452
452
 
453
453
  **[Releases](https://github.com/KudoAI/chatgpt.js/releases)** /
454
- [Userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.7.0/docs/USERGUIDE.md) /
454
+ [Userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.7.1/docs/USERGUIDE.md) /
455
455
  [Discuss](https://github.com/KudoAI/chatgpt.js/discussions) /
456
456
  [Back to top ↑](#top)
457
457
 
package/chatgpt.js CHANGED
@@ -24,11 +24,13 @@ const chatgpt = {
24
24
 
25
25
  selectors: {
26
26
  btns: {
27
- continue: 'button.btn:has([d^="M4.47189"])', login: '[data-testid*=login]',
27
+ continue: 'button:has([class*=rotate] [d^="M4.47189"])', login: '[data-testid*=login]',
28
28
  newChat: 'button[data-testid*=new-chat-button],' // sidebar button (when logged in)
29
29
  + 'button:has([d^="M3.06957"]),' // Cycle Arrows icon (Temp chat mode)
30
30
  + 'button:has([d^="M15.6729"])', // Pencil icon (recorded chat mode)
31
- regen: 'button:has([d^="M3.06957"])', scroll: 'button:has([d^="M12 21C11.7348"])',
31
+ regen: 'button[data-testid*="regenerate"],' // oval button in place of chatbar on errors
32
+ + 'div[role=menuitem]:has([d^="M3.06957"])', // 'Try Again' entry of model selector below msg
33
+ scroll: 'button:has([d^="M12 21C11.7348"])',
32
34
  send: '[data-testid=send-button]', sidebar: 'button[data-testid*=sidebar-button]',
33
35
  stop: 'button[data-testid=stop-button]', voice: 'button[data-testid*=composer-speech-button]'
34
36
  },
@@ -1851,6 +1853,7 @@ const chatgpt = {
1851
1853
  hide() { this.isOn() ? this.toggle() : console.info('Sidebar already hidden!') },
1852
1854
  show() { this.isOff() ? this.toggle() : console.info('Sidebar already shown!') },
1853
1855
  isOff() { return !this.isOn() },
1856
+
1854
1857
  isOn() {
1855
1858
  const sidebar = (() => {
1856
1859
  return chatgpt.sidebar.exists() ? document.querySelector(chatgpt.selectors.sidebar) : null })()
@@ -2089,7 +2092,6 @@ const cjsFuncSynonyms = [
2089
2092
  } while (aliasFuncCreated) // loop over new functions to encompass all variations
2090
2093
  })()
2091
2094
 
2092
-
2093
2095
  // Define HELPER functions
2094
2096
 
2095
2097
  function toCamelCase(words) {
@@ -4,7 +4,7 @@
4
4
  * User guide: https://chatgptjs.org/userguide
5
5
  * Latest minified release: https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js/chatgpt.min.js
6
6
  */
7
- localStorage.alertQueue=JSON.stringify([]),localStorage.notifyProps=JSON.stringify({queue:{topRight:[],bottomRight:[],bottomLeft:[],topLeft:[]}});let chatgpt={endpoints:{assets:"https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@80e09ad9c03cbae34429bbc68ded15d98408d9a5",openAI:{session:"https://chatgpt.com/api/auth/session",chats:"https://chatgpt.com/backend-api/conversations",chat:"https://chatgpt.com/backend-api/conversation",share_create:"https://chatgpt.com/backend-api/share/create",share:"https://chatgpt.com/backend-api/share",instructions:"https://chatgpt.com/backend-api/user_system_messages"}},selectors:{btns:{continue:'button.btn:has([d^="M4.47189"])',login:"[data-testid*=login]",newChat:'button[data-testid*=new-chat-button],button:has([d^="M3.06957"]),button:has([d^="M15.6729"])',regen:'button:has([d^="M3.06957"])',scroll:'button:has([d^="M12 21C11.7348"])',send:"[data-testid=send-button]",sidebar:"button[data-testid*=sidebar-button]",stop:"button[data-testid=stop-button]",voice:"button[data-testid*=composer-speech-button]"},chatDivs:{convo:"main > div > div > div > div > div > div[class*=group]",msg:"div[data-message-author-role]",reply:"div[data-message-author-role=assistant]"},chatHistory:"nav",errors:{txt:"[class*=text-error]"},footer:".min-h-4",header:"main .sticky",links:{newChat:'nav a[href="/"]',sidebarItem:"nav a"},sidebar:"div[class*=sidebar]",ssgManifest:'script[src*="_ssgManifest.js"]'},actAs(s){return new Promise((r,a)=>{let n=new XMLHttpRequest;n.open("GET","https://cdn.jsdelivr.net/gh/KudoAI/chat-prompts@80e09ad9c03cbae34429bbc68ded15d98408d9a5/dist/personas.min.json",!0),n.send(),n.onload=()=>{if(200!=n.status)return a("🤖 chatgpt.js >> Request failed. Cannot retrieve prompts data.");var e=JSON.parse(n.responseText).personas;if(s){var t=e.find(e=>e.title.toLowerCase()==s.toLowerCase());if(!t)return a(`🤖 chatgpt.js >> Persona '${s}' was not found!`);chatgpt.send(t.prompt,"click"),console.info(`Loading ${s} persona...`),chatgpt.isIdle().then(()=>console.info("Persona activated!"))}else{console.log("\n%c🤖 chatgpt.js personas\n","font-family: sans-serif ; font-size: xxx-large ; font-weight: bold");for(var o of e)console.log("%c"+o.title,"font-family: monospace ; font-size: larger ;")}return r()}})},activateDarkMode(){document.documentElement.classList.replace("light","dark"),document.documentElement.style.colorScheme=localStorage.theme="dark"},activateLightMode(){document.documentElement.classList.replace("dark","light"),document.documentElement.style.colorScheme=localStorage.theme="light"},alert(o,r,e,a,t){let n=chatgpt.isDarkMode()?"dark":"light",s=chatgpt.browser.isMobile(),i={dismiss:{click(e){e.target!=e.currentTarget&&!e.target.closest("[class*=-close-btn]")||f()},key(e){if(/^(?: |Space|Enter|Return|Esc)/.test(e.key)&&[32,13,27].includes(e.keyCode))for(var t of m){var t=document.getElementById(t);if(!t||"none"==t.style.display)return;e.key.startsWith("Esc")||27==e.keyCode?f():(t=t.querySelector(".modal-buttons").lastChild)&&(t.click(),e.preventDefault())}}},drag:{mousedown(e){var t;0==e.button&&"pointer"!=getComputedStyle(e.target).cursor&&(chatgpt.draggingModal=e.currentTarget,e.preventDefault(),Object.assign(chatgpt.draggingModal.style,{cursor:"grabbing",transition:"0.1s",willChange:"transform",transform:"scale(1.05)"}),[...chatgpt.draggingModal.children].forEach(e=>e.style.pointerEvents="none"),["mousemove","mouseup"].forEach(e=>document.addEventListener(e,i.drag[e])),t=chatgpt.draggingModal.getBoundingClientRect(),i.drag.offsetX=e.clientX-t.left+21,i.drag.offsetY=e.clientY-t.top+12)},mousemove(e){var t;chatgpt.draggingModal&&(t=e.clientX-i.drag.offsetX,e=e.clientY-i.drag.offsetY,Object.assign(chatgpt.draggingModal.style,{left:t+"px",top:e+"px"}))},mouseup(){Object.assign(chatgpt.draggingModal.style,{cursor:"inherit",transition:"inherit",willChange:"auto",transform:"scale(1)"}),[...chatgpt.draggingModal.children].forEach(e=>e.style.pointerEvents=""),["mousemove","mouseup"].forEach(e=>document.removeEventListener(e,i.drag[e])),chatgpt.draggingModal=null}}},c=document.createElement("div"),l=(c.id=Math.floor(1e6*chatgpt.randomFloat())+Date.now(),c.classList.add("chatgpt-modal"),document.createElement("div")),d=document.createElement("h2"),g=document.createElement("p");var u=1739338889852;let h=document.querySelector("#chatgpt-modal-style"),p=((!h||parseInt(h.getAttribute("last-updated"),10)<u)&&(h||((h=document.createElement("style")).id="chatgpt-modal-style",h.setAttribute("last-updated",u.toString()),document.head.append(h)),h.innerText=`.chatgpt-modal { /* vars */
7
+ localStorage.alertQueue=JSON.stringify([]),localStorage.notifyProps=JSON.stringify({queue:{topRight:[],bottomRight:[],bottomLeft:[],topLeft:[]}});let chatgpt={endpoints:{assets:"https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@14e69f71f651ad357f509f335a752b5549083bf8",openAI:{session:"https://chatgpt.com/api/auth/session",chats:"https://chatgpt.com/backend-api/conversations",chat:"https://chatgpt.com/backend-api/conversation",share_create:"https://chatgpt.com/backend-api/share/create",share:"https://chatgpt.com/backend-api/share",instructions:"https://chatgpt.com/backend-api/user_system_messages"}},selectors:{btns:{continue:'button:has([class*=rotate] [d^="M4.47189"])',login:"[data-testid*=login]",newChat:'button[data-testid*=new-chat-button],button:has([d^="M3.06957"]),button:has([d^="M15.6729"])',regen:'button[data-testid*="regenerate"],div[role=menuitem]:has([d^="M3.06957"])',scroll:'button:has([d^="M12 21C11.7348"])',send:"[data-testid=send-button]",sidebar:"button[data-testid*=sidebar-button]",stop:"button[data-testid=stop-button]",voice:"button[data-testid*=composer-speech-button]"},chatDivs:{convo:"main > div > div > div > div > div > div[class*=group]",msg:"div[data-message-author-role]",reply:"div[data-message-author-role=assistant]"},chatHistory:"nav",errors:{txt:"[class*=text-error]"},footer:".min-h-4",header:"main .sticky",links:{newChat:'nav a[href="/"]',sidebarItem:"nav a"},sidebar:"div[class*=sidebar]",ssgManifest:'script[src*="_ssgManifest.js"]'},actAs(s){return new Promise((r,a)=>{let n=new XMLHttpRequest;n.open("GET","https://cdn.jsdelivr.net/gh/KudoAI/chat-prompts@14e69f71f651ad357f509f335a752b5549083bf8/dist/personas.min.json",!0),n.send(),n.onload=()=>{if(200!=n.status)return a("🤖 chatgpt.js >> Request failed. Cannot retrieve prompts data.");var e=JSON.parse(n.responseText).personas;if(s){var t=e.find(e=>e.title.toLowerCase()==s.toLowerCase());if(!t)return a(`🤖 chatgpt.js >> Persona '${s}' was not found!`);chatgpt.send(t.prompt,"click"),console.info(`Loading ${s} persona...`),chatgpt.isIdle().then(()=>console.info("Persona activated!"))}else{console.log("\n%c🤖 chatgpt.js personas\n","font-family: sans-serif ; font-size: xxx-large ; font-weight: bold");for(var o of e)console.log("%c"+o.title,"font-family: monospace ; font-size: larger ;")}return r()}})},activateDarkMode(){document.documentElement.classList.replace("light","dark"),document.documentElement.style.colorScheme=localStorage.theme="dark"},activateLightMode(){document.documentElement.classList.replace("dark","light"),document.documentElement.style.colorScheme=localStorage.theme="light"},alert(o,r,e,a,t){let n=chatgpt.isDarkMode()?"dark":"light",s=chatgpt.browser.isMobile(),i={dismiss:{click(e){e.target!=e.currentTarget&&!e.target.closest("[class*=-close-btn]")||f()},key(e){if(/^(?: |Space|Enter|Return|Esc)/.test(e.key)&&[32,13,27].includes(e.keyCode))for(var t of m){var t=document.getElementById(t);if(!t||"none"==t.style.display)return;e.key.startsWith("Esc")||27==e.keyCode?f():(t=t.querySelector(".modal-buttons").lastChild)&&(t.click(),e.preventDefault())}}},drag:{mousedown(e){var t;0==e.button&&"pointer"!=getComputedStyle(e.target).cursor&&(chatgpt.draggingModal=e.currentTarget,e.preventDefault(),Object.assign(chatgpt.draggingModal.style,{cursor:"grabbing",transition:"0.1s",willChange:"transform",transform:"scale(1.05)"}),[...chatgpt.draggingModal.children].forEach(e=>e.style.pointerEvents="none"),["mousemove","mouseup"].forEach(e=>document.addEventListener(e,i.drag[e])),t=chatgpt.draggingModal.getBoundingClientRect(),i.drag.offsetX=e.clientX-t.left+21,i.drag.offsetY=e.clientY-t.top+12)},mousemove(e){var t;chatgpt.draggingModal&&(t=e.clientX-i.drag.offsetX,e=e.clientY-i.drag.offsetY,Object.assign(chatgpt.draggingModal.style,{left:t+"px",top:e+"px"}))},mouseup(){Object.assign(chatgpt.draggingModal.style,{cursor:"inherit",transition:"inherit",willChange:"auto",transform:"scale(1)"}),[...chatgpt.draggingModal.children].forEach(e=>e.style.pointerEvents=""),["mousemove","mouseup"].forEach(e=>document.removeEventListener(e,i.drag[e])),chatgpt.draggingModal=null}}},c=document.createElement("div"),l=(c.id=Math.floor(1e6*chatgpt.randomFloat())+Date.now(),c.classList.add("chatgpt-modal"),document.createElement("div")),d=document.createElement("h2"),g=document.createElement("p");var u=1739338889852;let h=document.querySelector("#chatgpt-modal-style"),p=((!h||parseInt(h.getAttribute("last-updated"),10)<u)&&(h||((h=document.createElement("style")).id="chatgpt-modal-style",h.setAttribute("last-updated",u.toString()),document.head.append(h)),h.innerText=`.chatgpt-modal { /* vars */
8
8
  --transition: opacity 0.65s cubic-bezier(.165,.84,.44,1), /* for fade-in */
9
9
  transform 0.55s cubic-bezier(.165,.84,.44,1) ; /* for move-in */
10
10
  --bg-transition: background-color 0.25s ease ; /* for bg dim */
package/docs/README.md CHANGED
@@ -49,8 +49,8 @@
49
49
  <img src="https://img.shields.io/github/stars/KudoAI/chatgpt.js?label=Stars&color=af68ff&logo=github&logoColor=white&labelColor=464646&style=for-the-badge"></a>
50
50
  <a href="https://github.com/KudoAI/chatgpt.js/blob/main/LICENSE.md">
51
51
  <img src="https://img.shields.io/badge/License-MIT-green.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
52
- <a href="https://github.com/KudoAI/chatgpt.js/tree/v3.7.0/dist/chatgpt.min.js">
53
- <img src="https://img.shields.io/github/size/KudoAI/chatgpt.js/dist/chatgpt.min.js?branch=v3.7.0&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
52
+ <a href="https://github.com/KudoAI/chatgpt.js/tree/v3.7.1/dist/chatgpt.min.js">
53
+ <img src="https://img.shields.io/github/size/KudoAI/chatgpt.js/dist/chatgpt.min.js?branch=v3.7.1&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
54
54
  <a href="https://www.codefactor.io/repository/github/kudoai/chatgpt.js">
55
55
  <img src="https://img.shields.io/codefactor/grade/github/kudoai/chatgpt.js?label=Code+Quality&logo=codefactor&logoColor=white&labelColor=464646&color=1acc6c&style=for-the-badge"></a>
56
56
  <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=kudoai_chatgpt.js">
@@ -111,7 +111,7 @@
111
111
 
112
112
  ```js
113
113
  (async () => {
114
- await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.0/dist/chatgpt.min.js');
114
+ await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.1/dist/chatgpt.min.js');
115
115
  // Your code here...
116
116
  })();
117
117
  ```
@@ -120,7 +120,7 @@
120
120
 
121
121
  ```js
122
122
  var xhr = new XMLHttpRequest();
123
- xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.0/dist/chatgpt.min.js');
123
+ xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.1/dist/chatgpt.min.js');
124
124
  xhr.onload = function () {
125
125
  if (xhr.status === 200) {
126
126
  var chatgptJS = document.createElement('script');
@@ -143,7 +143,7 @@ function yourCode() {
143
143
 
144
144
  ```js
145
145
  ...
146
- // @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.0/dist/chatgpt.min.js
146
+ // @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.1/dist/chatgpt.min.js
147
147
  // ==/UserScript==
148
148
 
149
149
  // Your code here...
@@ -213,7 +213,7 @@ chatgpt.get('reply', 'last');
213
213
 
214
214
  Each call equally fetches the last response. If you think it works, it probably will... so just type it!
215
215
 
216
- If it didn't, check out the extended [userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.7.0/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!
216
+ If it didn't, check out the extended [userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.7.1/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!
217
217
 
218
218
  <img height=8px width="100%" src="https://assets.chatgptjs.org/images/separators/gradient-aqua.png?v=e638eac">
219
219
 
@@ -451,7 +451,7 @@ This library exists thanks to code, translations, issues & ideas from the follow
451
451
  <div align="center">
452
452
 
453
453
  **[Releases](https://github.com/KudoAI/chatgpt.js/releases)** /
454
- [Userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.7.0/docs/USERGUIDE.md) /
454
+ [Userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.7.1/docs/USERGUIDE.md) /
455
455
  [Discuss](https://github.com/KudoAI/chatgpt.js/discussions) /
456
456
  [Back to top ↑](#top)
457
457
 
package/docs/USERGUIDE.md CHANGED
@@ -165,7 +165,7 @@
165
165
 
166
166
  ```js
167
167
  (async () => {
168
- await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.0/dist/chatgpt.min.js');
168
+ await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.1/dist/chatgpt.min.js');
169
169
  // Your code here...
170
170
  })();
171
171
  ```
@@ -174,7 +174,7 @@
174
174
 
175
175
  ```js
176
176
  var xhr = new XMLHttpRequest();
177
- xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.0/dist/chatgpt.min.js');
177
+ xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.1/dist/chatgpt.min.js');
178
178
  xhr.onload = function () {
179
179
  if (xhr.status === 200) {
180
180
  var chatgptJS = document.createElement('script');
@@ -196,7 +196,7 @@ function yourCode() {
196
196
 
197
197
  ```js
198
198
  ...
199
- // @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.0/dist/chatgpt.min.js
199
+ // @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.1/dist/chatgpt.min.js
200
200
  // ==/UserScript==
201
201
 
202
202
  // Your code here...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kudoai/chatgpt.js",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "description": "Client-side JavaScript library for ChatGPT",
5
5
  "author": {
6
6
  "name": "KudoAI & contributors",
@@ -24,11 +24,13 @@ const chatgpt = {
24
24
 
25
25
  selectors: {
26
26
  btns: {
27
- continue: 'button.btn:has([d^="M4.47189"])', login: '[data-testid*=login]',
27
+ continue: 'button:has([class*=rotate] [d^="M4.47189"])', login: '[data-testid*=login]',
28
28
  newChat: 'button[data-testid*=new-chat-button],' // sidebar button (when logged in)
29
29
  + 'button:has([d^="M3.06957"]),' // Cycle Arrows icon (Temp chat mode)
30
30
  + 'button:has([d^="M15.6729"])', // Pencil icon (recorded chat mode)
31
- regen: 'button:has([d^="M3.06957"])', scroll: 'button:has([d^="M12 21C11.7348"])',
31
+ regen: 'button[data-testid*="regenerate"],' // oval button in place of chatbar on errors
32
+ + 'div[role=menuitem]:has([d^="M3.06957"])', // 'Try Again' entry of model selector below msg
33
+ scroll: 'button:has([d^="M12 21C11.7348"])',
32
34
  send: '[data-testid=send-button]', sidebar: 'button[data-testid*=sidebar-button]',
33
35
  stop: 'button[data-testid=stop-button]', voice: 'button[data-testid*=composer-speech-button]'
34
36
  },
@@ -1851,6 +1853,7 @@ const chatgpt = {
1851
1853
  hide() { this.isOn() ? this.toggle() : console.info('Sidebar already hidden!') },
1852
1854
  show() { this.isOff() ? this.toggle() : console.info('Sidebar already shown!') },
1853
1855
  isOff() { return !this.isOn() },
1856
+
1854
1857
  isOn() {
1855
1858
  const sidebar = (() => {
1856
1859
  return chatgpt.sidebar.exists() ? document.querySelector(chatgpt.selectors.sidebar) : null })()
@@ -2089,7 +2092,6 @@ const cjsFuncSynonyms = [
2089
2092
  } while (aliasFuncCreated) // loop over new functions to encompass all variations
2090
2093
  })()
2091
2094
 
2092
-
2093
2095
  // Define HELPER functions
2094
2096
 
2095
2097
  function toCamelCase(words) {
@@ -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 2025.2.21
6
+ // @version 2025.2.21.1
7
7
  // @license MIT
8
8
  // @icon https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@1fc50da/starters/greasemonkey/assets/images/icons/robot/icon48.png
9
9
  // @icon64 https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@1fc50da/starters/greasemonkey/assets/images/icons/robot/icon64.png
10
10
  // @match *://chatgpt.com/*
11
- // @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.0/dist/chatgpt.min.js
11
+ // @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.7.1/dist/chatgpt.min.js
12
12
  // @grant GM_getValue
13
13
  // @grant GM_setValue
14
14
  // @noframes