- Mozilla has updated Firefox, starting with version 77, to stop truncating text pasted into web forms.
- The browser will no longer be shortening such text, even if it exceeds the maximum number of characters set with the maxLength property.
- You can always check out the Firefox page for everything about the browser, from fixes to how-to guides.
- Visit our News Hub to learn more.
Mozilla has updated Firefox, starting with version 77, to stop truncating text pasted into web forms. The browser will no longer be shortening such text, even if it exceeds the maximum number of characters set with the maxLength property.
Truncating, which is simply a way of limiting text content, has some good uses. For example, developers use it to limit text length to guarantee that it is precise.
But it has a flip side, especially if the content being pasted into a web form is a password.
No more truncating of pasted passwords in Firefox 77 or later
Every character in a password counts. So, tampering with such content is bound to cause problems for users trying to access password-protected websites or online portals.
It could result in a website rejecting the original password because it saved a shortened version. That was was the problem with Firefox before the latest change.
Users would copy and paste long passwords, such as from a password manager, into a web form or text field. The browser would then automatically truncate the pasted combination.
The problem is no more.
Verified-fixed on latest Nightly 77.0a1 (2020-05-04) on Windows 10 and MacOS 10.13.The field will get a red highlight after pasting in a string that is longer than the maxlength. The warning highlight is also dismissed if the user shortens the length to the maximum value.”
How the fix works
Developers will still be able apply the maxLength attribute, including to fields that capture user passwords.
If the form or field receives text that is longer than the specified character limit, there will be a red border around it.
Besides, an error message will accompany the red highlight in Firefox. It will prompt the user to reduce the number of characters to the specified maximum. Also, it will show the number of characters that the text field has captured.
The user has to shorten the password as per the applicable maxLength restriction. Otherwise, they will not be able to send the invalid form to the server.
You can always share your suggestions or ask any question in the comments section below.