diff --git a/chatgpt.js b/chatgpt.js index 4e2e8f21c..715b278a5 100644 --- a/chatgpt.js +++ b/chatgpt.js @@ -1482,7 +1482,7 @@ const chatgpt = { // eslint-disable-line no-redeclare send(msg, method='') { for (let i = 0; i < arguments.length; i++) if (typeof arguments[i] !== 'string') return console.error(`Argument ${ i + 1 } must be a string!`); - const textArea = document.querySelector('form textarea'); + const textArea = chatgpt.getChatBox(); if (!textArea) return console.error('Chatbar element not found!'); textArea.value = msg; textArea.dispatchEvent(new Event('input', { bubbles: true })); // enable send button diff --git a/starters/chrome/extension/lib/chatgpt.js b/starters/chrome/extension/lib/chatgpt.js index 9f2be61b3..319f427f3 100644 --- a/starters/chrome/extension/lib/chatgpt.js +++ b/starters/chrome/extension/lib/chatgpt.js @@ -1482,7 +1482,7 @@ const chatgpt = { // eslint-disable-line no-redeclare send(msg, method='') { for (let i = 0; i < arguments.length; i++) if (typeof arguments[i] !== 'string') return console.error(`Argument ${ i + 1 } must be a string!`); - const textArea = document.querySelector('form textarea'); + const textArea = chatgpt.getChatBox(); if (!textArea) return console.error('Chatbar element not found!'); textArea.value = msg; textArea.dispatchEvent(new Event('input', { bubbles: true })); // enable send button