Skip to content

Commit

Permalink
feat: handle custom GPT sandbox chat
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Nov 12, 2023
1 parent a3891e8 commit b97c766
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion content/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ function updatedBadge(message: string, isError: boolean = false) {
chrome.runtime.onMessage.addListener((request: Request) => {
if (request.type === RequestType.DATA) {
if (request.value.action === Action.ASK) {
const promptTextarea: HTMLTextAreaElement | null = document.querySelector('textarea#prompt-textarea')
// Handle both normal chats and Custom GPT sandbox chat which have 2 textareas
const promptTextareas: NodeListOf<HTMLTextAreaElement> = document.querySelectorAll('textarea#prompt-textarea')
const promptTextarea: HTMLTextAreaElement | undefined = promptTextareas[2] || promptTextareas[1]
if (!promptTextarea) {
return
}
Expand Down

0 comments on commit b97c766

Please sign in to comment.