-
Notifications
You must be signed in to change notification settings - Fork 11
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
[FormAnalyzer] Fix paperlesspost.com login form #711
Conversation
@@ -272,7 +272,7 @@ class FormAnalyzer { | |||
if (likelyASubmit) { | |||
this.form.querySelectorAll('input[type=submit], button[type=submit]').forEach((submit) => { | |||
// If there is another element marked as submit and this is not, flip back to false | |||
if (el.type !== 'submit' && el !== submit) { | |||
if (el.getAttribute('type') !== 'submit' && el !== submit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is what we want to do here - check if this element if it's explicitly a submit type, although I am not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol, this is wild. Nice find.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great find, thanks!
@@ -272,7 +272,7 @@ class FormAnalyzer { | |||
if (likelyASubmit) { | |||
this.form.querySelectorAll('input[type=submit], button[type=submit]').forEach((submit) => { | |||
// If there is another element marked as submit and this is not, flip back to false | |||
if (el.type !== 'submit' && el !== submit) { | |||
if (el.getAttribute('type') !== 'submit' && el !== submit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol, this is wild. Nice find.
Task/Issue URL: https://app.asana.com/0/1208923931185505/1208923931185505 Autofill Release: https://github.com/duckduckgo/duckduckgo-autofill/releases/tag/16.0.0 ## Description Updates Autofill to version [16.0.0](https://github.com/duckduckgo/duckduckgo-autofill/releases/tag/16.0.0). ### Autofill 16.0.0 release notes ## What's Changed This PR introduces breaking changes for Android/Windows causing save autofill prompt to get triggered in username only fields. * Upgrade to shared eslint config + Adopt Prettier by @muodov in duckduckgo/duckduckgo-autofill#695 * Ignore lint PR in git blame by @muodov in duckduckgo/duckduckgo-autofill#699 * Update password-related json files (2024-11-18) by @daxmobile in duckduckgo/duckduckgo-autofill#706 * [Form] Always scan shadow elements when categorizing the form inputs by @dbajpeyi in duckduckgo/duckduckgo-autofill#703 * Bump ts-to-zod from 3.1.3 to 3.14.0 by @dependabot in duckduckgo/duckduckgo-autofill#710 * [FormAnalyzer] Fix paperlesspost.com login form by @dbajpeyi in duckduckgo/duckduckgo-autofill#711 * [FormAnalyzer] Tweak regex to match forgot password attribute by @dbajpeyi in duckduckgo/duckduckgo-autofill#712 * [Form] Trigger partialSave on username/email only form submit by @dbajpeyi in duckduckgo/duckduckgo-autofill#702 **Full Changelog**: duckduckgo/duckduckgo-autofill@15.1.0...16.0.0 ## Steps to test This release has been tested during autofill development. For smoke test steps see [this task](https://app.asana.com/0/1198964220583541/1200583647142330/f). Co-authored-by: dbajpeyi <[email protected]>
Task/Issue URL: https://app.asana.com/0/1208923931185505/1208923931185505 Autofill Release: https://github.com/duckduckgo/duckduckgo-autofill/releases/tag/16.0.0 BSK PR: duckduckgo/BrowserServicesKit#1122 ## Description Updates Autofill to version [16.0.0](https://github.com/duckduckgo/duckduckgo-autofill/releases/tag/16.0.0). ### Autofill 16.0.0 release notes ## What's Changed This PR introduces breaking changes for Android/Windows causing save autofill prompt to get triggered in username only fields. * Upgrade to shared eslint config + Adopt Prettier by @muodov in duckduckgo/duckduckgo-autofill#695 * Ignore lint PR in git blame by @muodov in duckduckgo/duckduckgo-autofill#699 * Update password-related json files (2024-11-18) by @daxmobile in duckduckgo/duckduckgo-autofill#706 * [Form] Always scan shadow elements when categorizing the form inputs by @dbajpeyi in duckduckgo/duckduckgo-autofill#703 * Bump ts-to-zod from 3.1.3 to 3.14.0 by @dependabot in duckduckgo/duckduckgo-autofill#710 * [FormAnalyzer] Fix paperlesspost.com login form by @dbajpeyi in duckduckgo/duckduckgo-autofill#711 * [FormAnalyzer] Tweak regex to match forgot password attribute by @dbajpeyi in duckduckgo/duckduckgo-autofill#712 * [Form] Trigger partialSave on username/email only form submit by @dbajpeyi in duckduckgo/duckduckgo-autofill#702 **Full Changelog**: duckduckgo/duckduckgo-autofill@15.1.0...16.0.0 ## Steps to test This release has been tested during autofill development. For smoke test steps see [this task](https://app.asana.com/0/1198964220583541/1200583647142330/f). --------- Co-authored-by: dbajpeyi <[email protected]> Co-authored-by: Graeme Arthur <[email protected]>
Task/Issue URL: https://app.asana.com/0/1208923931185505/1208923931185505 Autofill Release: https://github.com/duckduckgo/duckduckgo-autofill/releases/tag/16.0.0 BSK PR: duckduckgo/BrowserServicesKit#1122 ## Description Updates Autofill to version [16.0.0](https://github.com/duckduckgo/duckduckgo-autofill/releases/tag/16.0.0). ### Autofill 16.0.0 release notes ## What's Changed This PR introduces breaking changes for Android/Windows causing save autofill prompt to get triggered in username only fields. * Upgrade to shared eslint config + Adopt Prettier by @muodov in duckduckgo/duckduckgo-autofill#695 * Ignore lint PR in git blame by @muodov in duckduckgo/duckduckgo-autofill#699 * Update password-related json files (2024-11-18) by @daxmobile in duckduckgo/duckduckgo-autofill#706 * [Form] Always scan shadow elements when categorizing the form inputs by @dbajpeyi in duckduckgo/duckduckgo-autofill#703 * Bump ts-to-zod from 3.1.3 to 3.14.0 by @dependabot in duckduckgo/duckduckgo-autofill#710 * [FormAnalyzer] Fix paperlesspost.com login form by @dbajpeyi in duckduckgo/duckduckgo-autofill#711 * [FormAnalyzer] Tweak regex to match forgot password attribute by @dbajpeyi in duckduckgo/duckduckgo-autofill#712 * [Form] Trigger partialSave on username/email only form submit by @dbajpeyi in duckduckgo/duckduckgo-autofill#702 **Full Changelog**: duckduckgo/duckduckgo-autofill@15.1.0...16.0.0 ## Steps to test This release has been tested during autofill development. For smoke test steps see [this task](https://app.asana.com/0/1198964220583541/1200583647142330/f). --------- Co-authored-by: dbajpeyi <[email protected]> Co-authored-by: Graeme Arthur <[email protected]>
Reviewer: @shakyShane @GioSensation
Asana: https://app.asana.com/0/1200930669568058/1208734403743969/f
Description
paperlesspost.com login form is treated by autofill as
signup
because the button element with text "Do you have an account? Sign Up" get's marked as "likely a submit", causing the score to skyrocket to +20:The problem is that this condition of
el.type
is always'submit'
, unless type was explicitly set to something else.Checking
el.type
defaults to'submit'
when nothing is set on the button (as buttons are submit by default), although in think in this case we want to be explicitly checking the submit attribute withgetAttrinute('type')
instead, to know that a button was explicitly set usingsubmit
.Form signals (before)
Form signals (after)
Steps to test