ferraridavide / ChatGPTPowerToys

138 stars 49 forks source link

GPT never answers question, cursor keeps flashing #3

Closed nitros0987 closed 1 year ago

nitros0987 commented 1 year ago

Hi Davide,

I love this addon and idea. Thank you. My only issue is that after this addon successfully injects my search term from Power Toys to Chat GPT, GPT never responds. If I create a new conversation and type into GPT without using this addon, GPT replies and works ok. However, when the input has been injected from Tampermonkey, GPT only keeps flashing and never responds to my question even after refreshing the page. I am using Brave as my browser, and this is the only problem I can think of.

Thank you again for taking the time to read this.

Kind regards, Tomás

image

ferraridavide commented 1 year ago

Hi! I was able to replicate the problem on different browsers. It seems that the prompt is being triggered too soon by the Tampermonkey script, even before the ChatGPT page can load the authentication session token. While this seems to be a bug on ChatGPT's end, my recommendation is to extend the interval in the setTimeout function within the Tampermonkey script.

setTimeout(() => {
            textArea.value = prompt;
            submitButton.click();
        }, 500);

Here I have adjusted the interval to 500 milliseconds, which should allow ample time for the page to fully load.

nitros0987 commented 1 year ago

Thank works perfect. Thank you very much :)