11

I want to disable google chrome autocomplete / autofill / use password suggestion
Something similar with autocomplete="off" (this one is not working).

The code is as following

loginpage.php

<form class="form-method" method="post">
    <span class="form-fill">
      <text>Username</text>
      <input placeholder="Username" required/>
      <text>Password</text>
      <input type="password" placeholder="Password" required/>
      <button type="submit"></button>
    </span>
</form>

anotherform.php

<form method="REQUEST" class="vp-method">
    <input type="password" maxlength="4" autocomplete="JUST STOP!"/>
    <button type="submit" placeholder="DVN Number">Validate</button>
</form>


How to disable this google chrome autocomplete / suggestion / autofill WITHOUT using javascript?

Note : I'm aware of duplicating question. And none of those suggestion is working (as I'm typing right now).

Thank you :)

Satrio Wibowo
  • 113
  • 1
  • 1
  • 8

2 Answers2

41

Chrome no longer supports autocomplete="off". Use autocomplete="new-password"instead.
Mozilla link

From the documentation:

For this reason, many modern browsers do not support autocomplete="off" for login fields:

If a site sets autocomplete="off" for username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits the page. This is the behavior in Firefox (since version 38), Google Chrome (since 34), and Internet Explorer (since version 11).

If an author would like to prevent the autofilling of password fields in user management pages where a user can specify a new password for someone other than themself, autocomplete="new-password" should be specified, though support for this has not been implemented in all browsers yet.

Another solution is using autocomplete="false". Here are a few links to other SO questions that may help:

SO - Disabling Chrome Autofill

SO - Chrome Browser Ignoring AutoComplete=Off

SO - Chrome 63+ Autocomplete Bypass

Ethilium
  • 1,134
  • 1
  • 12
  • 18
  • 2
    Finally a good answer to this old-age problem – Jack Aug 02 '17 at 13:03
  • NB Recent Chrome as of now (61) does respect autocomplete="off" on inputs except in edge cases (usernames & passwords). – Benji XVI Oct 16 '17 at 13:36
  • Do you need the autocomplete="false" for other browsers? Or it is supported by all browsers? – read Jan 05 '18 at 17:41
  • 10
    This solution doesn't work for me, unfortunately, at least with Chrome 63. Values such as "false", "new-password", "" don't work. Chrome is just broken. I've tried clearing all data and cache, and Chrome is still filling fields. It must have a secret stash it's not clearing, apparently. I've reached out to a member of the Chrome team who pointed me to this post. He doesn't even know. Only Firefox of the major browsers works. Safari fails for me too. – Jackpile Feb 16 '18 at 13:40
  • 1
    As for me, I think that **'autocomplete' and 'auto-fill' are different things**. Auto-fill is browser specific feature to provide user to store values for the fields and it pre-populates the fields upon load. And if auto-fill works then it is normal to ignore "autocomplete = off". Autocomplete just shows drop-down with cached values for the input when user starts typing. – Klyuch Apr 18 '19 at 16:36
2

I tried to confuse the browser so that it wouldn't know which input field to fill, and this seems to be cross platform - can't test it on explorer thouth...

Try this, or something along these lines:

<input type="password" class="bigText login" name="hiddenFieldToStopBrowserAutofill" style = "height : 0px; width : 0px; border : 0px"/>

From what I saw, it only works if you specify the same class as another of the fields in the form ( in this case i have "bigText login" for both password and email address ) and then make it invisible in the way I described above. If you try to use "display = none" instead, it won't work.

I also tried some variations of value = "", value = " " and so on to stop the browser replacing the string with what it wants to force on the page, but it didn't work... Saves you time trying that if you were hoping for a cleaner opton

Dan
  • 448
  • 5
  • 21