Improving max_length for autofill |
|||
Issue descriptionIn form_autofill_util.cc / WebFormControlElementToFormField() we copy the maxlength attribute into FormFieldData. In practice a number of sites seem to rely on data-val-length-max which is used by jQuery for form validation. Maybe we should consider that value as well. I noticed this when looking at requirements for password generation.
,
Jun 27 2018
Hello, I'm interesting in solving this! But I'm wondering how to do this. Should I create a new member variable for FormFieldData like: field->data_val_length_max = data_val_length_max; Or compare it between max_length and then copy the max or min like: field->max_length = MaxOrMin(input_element->MaxLength(), data_val_length_max)
,
Jun 27 2018
This is pretty interesting! We've seen a number of cases where the maxlength would be 12 but the site would truncate to 10 for example. I think in general keeping the smallest is what would be most useful to us, at least for Autofill. My only worry is the quality of that data. For example, I would't want to override a maxlength of 10 with a data_val_... of 0. I really don't know if that happens in the wild though. battre@ do you have a preference in regards to Password Generation?
,
Jun 29 2018
Yes, I was also thinking of keeping the smallest for password generation. My thought was to go with field->max_length = Min(input_element->MaxLength(), data_val_length_max) but you raise a good point about abuse. WDYT? Should we go for field->data_val_length_max = data_val_length_max;? +nepper as this is would lead to a user facing change.
,
Oct 22
Could we crowdsource this value (the length of data most people enter)? It would solve a lot of cases. Another common one is setting autocomplete="cc-exp" (MM/YYYY) but in reality expecting MM/YY. Autofill will only do the right thing if the website sets maxlength="5".
,
Oct 23
Crowdsourcing is another interesting approach. +rogerm@ for his thoughts on that. |
|||
►
Sign in to add a comment |
|||
Comment 1 by battre@chromium.org
, Jun 26 2018