Skip to content

Instantly share code, notes, and snippets.

@frispete
Forked from david0/strip-autocomplete.user.js
Last active January 27, 2021 12:57
Show Gist options
  • Save frispete/14e8b3fc8ca6fe607724b1b94972aeca to your computer and use it in GitHub Desktop.
Save frispete/14e8b3fc8ca6fe607724b1b94972aeca to your computer and use it in GitHub Desktop.
Greasymonkey/Tampermonkey script that strips "autocomplete" attributes from username and password fields
// ==UserScript==
// @name Enable autocomplete attributes
// @namespace frispete
// @version 0.1
// @description This plugin gives the control about your passwords back to your browser and allows the browser to store every password.
// @include http://*
// @include https://*
// @copyright 2014, David, 2021, frispete
// forked from: https://gist.github.com/david0/9327296
// Usage: Install TamperMonkey, load this page and push raw view of script
// ==/UserScript==
function enableAutocomplete(element) {
if element.hasAttribute("autocomplete")
element.setAttribute("autocomplete", "on");
}
var forms = document.getElementsByTagName('form');
for (var i=0; i<forms.length; i++)
enableAutocomplete(forms[i]);
var inputElements = document.getElementsByTagName('input');
for (var i=0; i<inputElements.length; i++)
enableAutocomplete(inputElements[i]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment