Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submit button remains disabled and won't click #1

Open
odebroqueville opened this issue Jul 18, 2023 · 0 comments
Open

Submit button remains disabled and won't click #1

odebroqueville opened this issue Jul 18, 2023 · 0 comments

Comments

@odebroqueville
Copy link

odebroqueville commented Jul 18, 2023

Hi Nithur, just to let you know that the submit button remains disabled. It seems that the class list has changed. I used the latest class list: 'absolute p-1 rounded-md md:bottom-3 md:p-2 md:right-3 dark:hover:bg-gray-900 dark:disabled:hover:bg-transparent right-2 disabled:text-gray-400 enabled:bg-brand-purple text-white bottom-1.5 transition-colors disabled:opacity-40', but it still doesn't click. The submit button is no longer disabled and turns purple instead of green, but it still doesn't click!

UPDATE: I changed the ask function as follows, but I still can't get it to click! I hope you can make it work!

async function askChatGPT(query) {
    const observer = new MutationObserver(function (mutations, mutationInstance) {
        const someDiv = document.getElementsByTagName("h1")[0];
        if (someDiv) {
            const textarea = document.getElementsByTagName("textarea")[0];
            textarea.textContent = query;
            const buttons = document.getElementsByTagName("button");
            const submit = buttons[buttons.length - 1];
            submit.disabled = false;
            submit.click();

            mutationInstance.disconnect();
        }
    });

    observer.observe(document, {
        childList: true,
        subtree: true
    });
}
@odebroqueville odebroqueville changed the title Submit button remains disabled Submit button remains disabled and won't click Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant