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

call submit/reset from prototype in case they are masked by form controls #803

Merged
merged 1 commit into from Apr 27, 2021

Conversation

ZekeLu
Copy link
Member

@ZekeLu ZekeLu commented Apr 27, 2021

fix #802

If a form control (such as a submit button) has a name or id of submit, it will mask the form's submit method. The same will happen to the reset method (see HTMLFormElement.submit()). The consequence is that it's not safe to call form.submit() or form.reset() directly. This PR fixes the issue by calling submit/reset like this: HTMLFormElement.prototype.submit.call(form)/HTMLFormElement.prototype.reset.call(form).

@kenshaw kenshaw merged commit 6ba664d into chromedp:master Apr 27, 2021
@ZekeLu ZekeLu deleted the form branch April 27, 2021 06:15
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

Successfully merging this pull request may close these issues.

Ignore javascript errors (a submit input with the name "submit")
2 participants