Skip to content

Commit

Permalink
Bumped chatgpt.js to 2.9.3 ↞ [auto-sync from `adamlui/chatgpt-apps/ch…
Browse files Browse the repository at this point in the history
…atgpt-infinity/chrome`]
  • Loading branch information
adamlui authored and kudo-sync-bot committed May 24, 2024
1 parent 1578263 commit 9f004b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions edge/extension/lib/chatgpt.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This library is a condensed version of chatgpt.js v2.9.2
// This library is a condensed version of chatgpt.js v2.9.3
// © 2023–2024 KudoAI & contributors under the MIT license.
// Source: https://github.com/KudoAI/chatgpt.js
// User guide: https://chatgptjs.org/userguide
Expand Down Expand Up @@ -236,7 +236,8 @@ const chatgpt = {

getNewChatButton: function() {
for (const navBtnSVG of document.querySelectorAll('nav button svg'))
if (navBtnSVG.querySelector('path[d*="M15.673 3.913a3.121"]')) // new chat icon found
if (navBtnSVG.querySelector('path[d*="M15.673 3.913a3.121"], ' // pencil-on-pad icon
+ 'path[d*="M3.07 10.876C3.623"]')) // refresh icon if temp chat
return navBtnSVG.parentNode;
},

Expand Down Expand Up @@ -265,15 +266,15 @@ const chatgpt = {
return new Promise(resolve => {
(function checkIsIdle() {
if (chatgpt.getRegenerateButton()) resolve(true);
else setTimeout(checkIsIdle, 100);
else setTimeout(checkIsIdle, 200);
})();
});},

isLoaded: function() {
return new Promise(resolve => {
(function checkIsLoaded() {
if (chatgpt.getNewChatButton()) resolve(true);
else setTimeout(checkIsLoaded, 100);
else setTimeout(checkIsLoaded, 200);
})();
});},

Expand Down
9 changes: 5 additions & 4 deletions opera/extension/lib/chatgpt.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This library is a condensed version of chatgpt.js v2.9.2
// This library is a condensed version of chatgpt.js v2.9.3
// © 2023–2024 KudoAI & contributors under the MIT license.
// Source: https://github.com/KudoAI/chatgpt.js
// User guide: https://chatgptjs.org/userguide
Expand Down Expand Up @@ -236,7 +236,8 @@ const chatgpt = {

getNewChatButton: function() {
for (const navBtnSVG of document.querySelectorAll('nav button svg'))
if (navBtnSVG.querySelector('path[d*="M15.673 3.913a3.121"]')) // new chat icon found
if (navBtnSVG.querySelector('path[d*="M15.673 3.913a3.121"], ' // pencil-on-pad icon
+ 'path[d*="M3.07 10.876C3.623"]')) // refresh icon if temp chat
return navBtnSVG.parentNode;
},

Expand Down Expand Up @@ -265,15 +266,15 @@ const chatgpt = {
return new Promise(resolve => {
(function checkIsIdle() {
if (chatgpt.getRegenerateButton()) resolve(true);
else setTimeout(checkIsIdle, 100);
else setTimeout(checkIsIdle, 200);
})();
});},

isLoaded: function() {
return new Promise(resolve => {
(function checkIsLoaded() {
if (chatgpt.getNewChatButton()) resolve(true);
else setTimeout(checkIsLoaded, 100);
else setTimeout(checkIsLoaded, 200);
})();
});},

Expand Down

0 comments on commit 9f004b7

Please sign in to comment.