polished send button query

This commit is contained in:
mic 2024-05-17 19:02:47 +02:00
parent 4eb6ef243b
commit 016779faf8

View file

@ -26,7 +26,6 @@ let force_go = false;
async function chatgpt_sendMsg(msg, method ='') {
const textArea = document.querySelector('form textarea'),
sendButton = document.querySelector('path[d*="M15.192 8.906a1.143"]')?.parentNode.parentNode // post-GPT-4o;
|| document.querySelector('form button[class*="main-surface-secondary"]') // pre-GPT-4o
|| document.querySelector('[data-testid="send-button"]'); // pre-GPT-4o
textArea.value = msg;
textArea.dispatchEvent(new Event('input', { bubbles: true })); // enable send button