talk-to-chatgpt icon indicating copy to clipboard operation
talk-to-chatgpt copied to clipboard

Code enhancement

Open justincontributor opened this issue 2 years ago • 2 comments

Hello, Thanks for this great extension.

function CN_SendMessage

rather than the hazardous : jQuery("#prompt-textarea").closest("div").find("button:last")

I propose : jQuery('[data-testid="send-button"]')

justincontributor avatar Nov 07 '23 20:11 justincontributor

Thanks - I will look into it. Is there any particular reason you are suggesting this?

C-Nedelcu avatar Nov 08 '23 09:11 C-Nedelcu

Hi, Yes, the reason is that there are changes with the buttons from time to time. Getting the button by ":last" could fail one day if another button comes up with a new chatpt option. With that, you would be more sure that you enable or click the good one.

It's not (yet) a bug. No hurry.

justincontributor avatar Nov 08 '23 13:11 justincontributor