Disable Chrome Autofill & Autocomplete With jQuery - disableAutoFill

Disable Chrome Autofill & Autocomplete With jQuery - disableAutoFill
File Size: 863 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

disableAutoFill is a lightweight jQuery plugin for disabling autofill and autocomplete functionalities in Google Chrome browser.

How it works:

  • Add random chars on "name" attribute to avid Browser remember what you submitted before.
  • Replace submit button to normal button to make sure everything works fine.

How to use it:

1. Insert the minified version of the disableAutoFill plugin after loading jQuery JavaScript library.

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" 
        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" 
        crossorigin="anonymous">
</script>
<script src="src/jquery.disableAutoFill.min.js"></script>

2. Call the function disableAutoFill() on the html form and done.

<form id="demo">
  <div class="form-group">
    <label for="exampleInputEmail1">Email address</label>
    <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
    <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
  </div>
  <div class="form-group">
    <label for="exampleInputPassword1">Password</label>
    <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
  </div>
  <button type="submit" class="btn btn-primary">Submit</button>
</form>
$(function(){

  $('#demo').disableAutoFill();

});

3. Specify the password field when there is no [type=passoword] field.

$('#demo').disableAutoFill({
  textToPassword: true,
  passwordFiled: ''
});

4. Specify the submit button when there is no [type=submit] button.

$('#demo').disableAutoFill({
  submitButton: ''
});

5. The plugin also provides a callback function which can be used to validate the form fields.

$('#demo').disableAutoFill({
  callback: function() {
    return true;
  },
});

6. Determine whether or not to randomize the input name..

$('#demo').disableAutoFill({
  randomizeInputName: true
});

7. Specify the character used to hide the real password value.

$('#demo').disableAutoFill({
  hidingChar: '●'
});

8. Enable/disable the native HTML form validation.

$('#demo').disableAutoFill({
  html5FormValidate: false
});

Changelog:

v1.2.8 (2019-04-04)

  • Fix asterisk in password problem and add hiding character parameter
  • Add support to multiple passwords fields

2019-02-20

  • Supports multiple password fields.

2018-12-17

  • Fixed: radio button

2018-11-20

  • Fixed: "realPassword" array goes out of sync if user backspaces / deletes / overwrites

2018-10-19

  • Fixed issues with passwordField

2018-09-03

  • v1.2.4: Fixed HTML5 form validation

2018-08-02

  • Bugfix

2018-08-01

  • Fix mutli form submit button issue

This awesome jQuery plugin is developed by terrylinooo. For more Advanced Usages, please check the demo page or visit the official website.