0

I am currently working on an Angular web-application.
This application consists of two single-page-applications:
- Login-Page, accessible over "domain/login.html", containing login-logic.
- Application-Page, accessible over "domain/", containing the concrete application.

If you try to access "domain/", the server redirects you to "domain/login.html", if you are not logged in yet. Otherwise you will get the Application-Page (no redirect).

In the concrete application there is a Change-Password-Page, where you have to enter the old password and the new password (twice).
The problems start, if you say "save password" on the login-page. The saved password is automatically filled inside the "Old-Password" field.
Also there is another page having a text field and a password field directly after each other (where the text-field is for a phonenumber) and the browser inserts the username into the "phonenumber"-field and the password inside the password field. This is really strange, as the fields have different names and ids and are even on another page (again one is "/login.html" and one is "/")

As this behaivor is incorrect i would really like to disable it. However I was not able to do that until now.
What i tryed:

  • autocomplete=off, for form and input-tags. This seems to be ignored by most modern browsers.
  • Two hidden (display:none) input-fields (text + password) on first position. Seems to work for Firefox, but Chrome and Opera still give you the possibility to autocomplete the fields.
  • Use type="text" for password-field and change it to password inside javascript-code. Again Opera and Chrome still give possibility to autocomplete those values.

So I am looking for a (clean) solution to turn off the wrong autocompletion. Is that somehow possible?

4
  • Have you tried adding <!DOCTYPE html> at the top of your html? (While using autocomplete=off on form and elements) Commented May 20, 2016 at 10:11
  • Have a look at this post maybe one of the mentioned approaches will do what you expect. Commented May 20, 2016 at 10:12
  • @rinukkusu thanks for your comment. The two html-pages allready have this tag on their beginning. So unfortunately this did not help Commented May 20, 2016 at 11:25
  • @mian I allready tryed most of those things... But i'll try the autocomplete=false option Commented May 20, 2016 at 11:26

1 Answer 1

0

I have been encountering this issue lately, specifically with chrome. It seems that

autocomplete="off"  || autocomplete="false"

are not being picked up anymore by Chrome (or most other browsers as far as i'm aware). I found the following sources helpful :

Chromium (which i believe is what a lot of Chrome is based on) has the following code that shows the regex that is used when finding fields to populate with Chrome's autocomplete:

https://cs.chromium.org/chromium/src/components/autofill/core/common/autofill_regex_constants.cc?sq=package:chromium&g=0&l=262

I feel like they only other work around that I have found is to follow these conventions : https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

Or at least make sure that you give an attribute that's disimilar enough from the above list so it that wont get picked up by autocomplete features.

Sign up to request clarification or add additional context in comments.

1 Comment

Setting the correct value (username) fixed my case. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.