diff options
author | Sami Vänttinen <sami.vanttinen@protonmail.com> | 2020-11-07 18:21:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-07 18:21:03 +0300 |
commit | 376510c3f8ba351f64ec5eb6e62b23c353a51a01 (patch) | |
tree | 765ba434459b97b4592f8c6098097d4de3dd02d4 /keepassxc-browser | |
parent | c273b3b9dd17eff41bef5471d72da8354ac64ebe (diff) | |
parent | bc2a1fcd12f9af60f68f87870450ef2bc5792bb2 (diff) |
Merge pull request #1099 from keepassxreboot/fix/extra_check_for_form_action
Add extra checks for form.action
Diffstat (limited to 'keepassxc-browser')
-rwxr-xr-x | keepassxc-browser/content/keepassxc-browser.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/keepassxc-browser/content/keepassxc-browser.js b/keepassxc-browser/content/keepassxc-browser.js index 13ea7e6..ee38c4f 100755 --- a/keepassxc-browser/content/keepassxc-browser.js +++ b/keepassxc-browser/content/keepassxc-browser.js @@ -155,6 +155,10 @@ kpxcForm.getCredentialFieldsFromForm = function(form) { // Get the form submit button instead if action URL is same as the page itself kpxcForm.getFormSubmitButton = function(form) { + if (!form.action || typeof form.action !== 'string') { + return; + } + const action = kpxc.submitUrl || form.action; // Special handling for accounts.google.com. The submit button is outside the form. @@ -221,6 +225,10 @@ kpxcForm.getNewPassword = function(passwordInputs = []) { // Initializes form and attaches the submit button to our own callback kpxcForm.init = function(form, credentialFields) { + if (!form.action || typeof form.action !== 'string') { + return; + } + if (!kpxcForm.formIdentified(form) && (credentialFields.password || credentialFields.username) || form.action.startsWith(kpxcSites.googlePasswordFormUrl)) { kpxcForm.saveForm(form, credentialFields); |