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

Add an additional submit technique before form.submit() #303

Open
luckyrat opened this issue Feb 4, 2021 · 0 comments
Open

Add an additional submit technique before form.submit() #303

luckyrat opened this issue Feb 4, 2021 · 0 comments

Comments

@luckyrat
Copy link
Member

luckyrat commented Feb 4, 2021

This might increase the success rate of form submissions by triggering the submit event on the webpage.

const button = document.createElement('input');
button.type = 'submit';
form.append(button);
button.click();
button.remove();

This was described as a workaround for the challenges that led to the recent introduction of form.requestSubmit() but in our case we already fake a user click on any button that we can correctly identify. When we can't find a button to click, this workaround might prove more reliable than the good old form.submit() fallback.

See: whatwg/html#4187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant