From faa263565fb23bfe0fdffe0fc289d530f2b9323e Mon Sep 17 00:00:00 2001 From: "adamlui@protonmail.com" Date: Thu, 12 Sep 2024 16:46:00 +0000 Subject: [PATCH] =?UTF-8?q?Updated=20`chatgpt.send()`=20to=20work=20w/=20n?= =?UTF-8?q?ew=20chatbar=20=E2=86=9E=20[auto-sync=20from=20`KudoAI/chatgpt.?= =?UTF-8?q?js`]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- starters/chrome/extension/lib/chatgpt.js | 3 ++- starters/chrome/extension/manifest.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/starters/chrome/extension/lib/chatgpt.js b/starters/chrome/extension/lib/chatgpt.js index 11dee4641..edd992e94 100644 --- a/starters/chrome/extension/lib/chatgpt.js +++ b/starters/chrome/extension/lib/chatgpt.js @@ -1499,7 +1499,8 @@ const chatgpt = { // eslint-disable-line no-redeclare return console.error(`Argument ${ i + 1 } must be a string!`); const textArea = chatgpt.getChatBox(); if (!textArea) return console.error('Chatbar element not found!'); - textArea.value = msg; + const msgP = document.createElement('p'); msgP.textContent = msg; + textArea.replaceChild(msgP, textArea.querySelector('p')); textArea.dispatchEvent(new Event('input', { bubbles: true })); // enable send button setTimeout(function delaySend() { const sendBtn = chatgpt.getSendButton(); diff --git a/starters/chrome/extension/manifest.json b/starters/chrome/extension/manifest.json index 0865870bb..dc5710753 100644 --- a/starters/chrome/extension/manifest.json +++ b/starters/chrome/extension/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "ChatGPT Extension", "description": "A Chrome template to start using chatgpt.js like a boss!", - "version": "2024.9.10", + "version": "2024.9.12", "author": "chatgpt.js", "icons": { "16": "icons/icon16.png",