mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-08-08 22:42:32 -04:00
add hack for submitting a login form containing an element with name or id "submit", which masks the form submit() method
This commit is contained in:
parent
b24b229cb2
commit
06fd0a0d79
1 changed files with 9 additions and 1 deletions
|
@ -561,7 +561,15 @@ var __brzl_tryLogin = function() {
|
|||
passwordField.value = {{password|json}};
|
||||
console.log('submitting username=' + usernameField.value
|
||||
+ ' password=*** to detected login form');
|
||||
try {
|
||||
form.submit();
|
||||
} catch (e) {
|
||||
// "If a form control (such as a submit button) has a name or
|
||||
// id of 'submit' it will mask the form's submit method." -MDN
|
||||
// http://stackoverflow.com/a/2000021
|
||||
var pseudoForm = document.createElement('form');
|
||||
pseudoForm.submit.apply(form);
|
||||
}
|
||||
__brzl_tryLoginState = 'submitted-form';
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue