diff --git a/src/content.ts b/src/content.ts index bf192cd..a26ac26 100644 --- a/src/content.ts +++ b/src/content.ts @@ -19,8 +19,7 @@ async function fetchDomElements (): Promise { const textarea: HTMLTextAreaElement | null = document.getElementById( 'prompt-textarea' ) as HTMLTextAreaElement | null - const button: HTMLButtonElement | null = - textarea?.parentElement?.parentElement?.querySelector(':scope > button') ?? null + const button: HTMLButtonElement | null = document.querySelector('button[aria-label="Send prompt"]') as HTMLButtonElement | null; if (textarea !== null && button !== null) { return { textarea, button } diff --git a/src/prompt.ts b/src/prompt.ts index 7abb000..295d99d 100644 --- a/src/prompt.ts +++ b/src/prompt.ts @@ -178,7 +178,7 @@ function addDetectorsToRegistry (): void { addDetectorsToRegistry() function extractPromptText (textarea: HTMLTextAreaElement | null): string { - const promptText: string | undefined = textarea?.value + const promptText: string | undefined = textarea?.innerText return promptText ?? '' }