From 52094949d5ba07ecce2cd66956d835179dd18f2f Mon Sep 17 00:00:00 2001 From: mwyywm Date: Fri, 31 May 2024 12:34:23 +0200 Subject: [PATCH 1/2] fix openai submit button selector --- src/providers/openai.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/providers/openai.js b/src/providers/openai.js index 4616193..df53559 100644 --- a/src/providers/openai.js +++ b/src/providers/openai.js @@ -21,8 +21,7 @@ class OpenAI extends Provider { static handleSubmit() { this.getWebview().executeJavaScript(`{ - // var btn = document.querySelector("textarea[placeholder*='Send a message']+button"); // this one broke recently .. note that they add another div (for the file upload) in code interpreter mode - var btn = document.querySelector('button[data-testid="send-button"]'); + var btn = document.querySelector('button[data-testid="fruitjuice-send-button"]'); if (btn) { btn.focus(); btn.disabled = false; From fd0bb80074ede8bca62995f0fe83db1fcdb4ea15 Mon Sep 17 00:00:00 2001 From: mwyywm Date: Mon, 29 Jul 2024 02:24:48 +0200 Subject: [PATCH 2/2] fix: openai selector Adding a fallback test-id selector for different versions of chatGPT. --- src/providers/openai.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/providers/openai.js b/src/providers/openai.js index df53559..a3d73a2 100644 --- a/src/providers/openai.js +++ b/src/providers/openai.js @@ -21,7 +21,7 @@ class OpenAI extends Provider { static handleSubmit() { this.getWebview().executeJavaScript(`{ - var btn = document.querySelector('button[data-testid="fruitjuice-send-button"]'); + var btn = document.querySelector('button[data-testid="send-button"]') || document.querySelector('button[data-testid="fruitjuice-send-button"]'); if (btn) { btn.focus(); btn.disabled = false;