Created
July 29, 2012 22:01
-
-
Save ingmar/3202085 to your computer and use it in GitHub Desktop.
Userscript to re-enable autocomplete on www.ocado.com and other places
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Autocomplete_anyways | |
// @description Removes counterproductive "autocomplete=off" attributes | |
// @version 1.0 | |
// @include http*://*.ocado.com/* | |
// @include http*://www.goodreads.com/* | |
// @include http*://www.t-mobile.co.uk/* | |
// ==/UserScript== | |
for (i=0; i < document.forms.length; i++) { | |
frm = document.forms[i]; | |
for (j=0; j < frm.elements.length; j++) { | |
ele = frm.elements[j]; | |
if (ele.attributes["autocomplete"] && ele.attributes["autocomplete"].value == "off") { | |
//ele.removeAttribute("autocomplete"); | |
ele.setAttribute("autocomplete", "on"); | |
} | |
} | |
// but wait! apparently form tags can have this too (t-mobile does this) | |
frm.setAttribute("autocomplete", "on"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment