Skip to content

Commit

Permalink
Updated chatgpt.sendInNewChat() to work in Logged Out session ↞ [au…
Browse files Browse the repository at this point in the history
…to-sync from `KudoAI/chatgpt.js`]
  • Loading branch information
adamlui authored and kudo-sync-bot committed Sep 12, 2024
1 parent e1e3f45 commit 1fccb70
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions starters/chrome/extension/lib/chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -1544,10 +1544,8 @@ const chatgpt = { // eslint-disable-line no-redeclare

sendInNewChat(msg) {
if (typeof msg !== 'string') return console.error('Message must be a string!');
for (const navLink of document.querySelectorAll('nav a')) {
if (/(new|clear) chat/i.test(navLink.text)) {
navLink.click(); break;
}} setTimeout(() => { chatgpt.send(msg); }, 500);
try { chatgpt.getNewChatBtn().click(); } catch (err) { return console.error(err.message); }
setTimeout(() => { chatgpt.send(msg); }, 500);
},

settings: {
Expand Down

0 comments on commit 1fccb70

Please sign in to comment.