1

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?

Springrbua
  • 8,377
  • 9
  • 48
  • 92
  • Have you tried adding ` ` at the top of your html? (While using `autocomplete=off` on form and elements) – rinukkusu May 20 '16 at 10:11
  • Have a look at this [post](http://stackoverflow.com/questions/15738259/disabling-chrome-autofill) maybe one of the mentioned approaches will do what you expect. – Michael Andorfer May 20 '16 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 – Springrbua May 20 '16 at 11:25
  • @mian I allready tryed most of those things... But i'll try the autocomplete=false option – Springrbua May 20 '16 at 11:26

1 Answers1

1

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.

AC007
  • 109
  • 7