mirror of
https://github.com/lencx/Noi.git
synced 2024-10-05 15:57:50 +03:00
Noi-ask Extensions: Update ChatGPT submit btn selector
`data-testid` does not exist on paid version. This fix works on both paid and unpaid version of ChatGPT. It relies on the dom structure: "main > last form > last button" should be the submit button
This commit is contained in:
parent
9787604e25
commit
c04e0e5a7b
@ -48,7 +48,10 @@ class OpenAIAsk extends NoiAsk {
|
||||
static url = 'https://chatgpt.com';
|
||||
|
||||
static submit() {
|
||||
const btn = document.querySelector('button[data-testid="send-button"]');
|
||||
const forms = document.querySelectorAll('main form');
|
||||
const form = forms[forms.length - 1];
|
||||
const buttons = form.querySelectorAll('button');
|
||||
const btn = buttons[buttons.length - 1];
|
||||
if (btn) this.autoClick(btn);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user