Skip to content

Instantly share code, notes, and snippets.

@ingmar
Created July 29, 2012 22:01
Show Gist options
  • Save ingmar/3202085 to your computer and use it in GitHub Desktop.
Save ingmar/3202085 to your computer and use it in GitHub Desktop.
Userscript to re-enable autocomplete on www.ocado.com and other places
// ==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