Skip to content

Instantly share code, notes, and snippets.

@Draky50110
Created September 6, 2014 13:19
Show Gist options
  • Save Draky50110/446b0ab9fdfa2ea7a023 to your computer and use it in GitHub Desktop.
Save Draky50110/446b0ab9fdfa2ea7a023 to your computer and use it in GitHub Desktop.
Make all forms to allow autocomplete + make all textarea resize possible
// ==UserScript==
// @name Autocomplete + textarea resize enabled
// @namespace http://?
// @description Make all forms to allow autocomplete + make all textarea resize possible
// @author Timo
// @license ?
// @include *
// @version 1
// @homepage http://?
// @grant none
// ==/UserScript==
var frm = document.getElementsByTagName('form');
for (var i = 0, n = frm.length; i < n; i++) {
frm[i].setAttribute('autocomplete', 'on');
}
var inp = document.getElementsByTagName('input');
for (var i = 0, n = inp.length; i < n; i++) {
if (inp[i].getAttribute('autocomplete') == 'off') {
inp[i].setAttribute('autocomplete', 'on');
}
}
var txtarea = document.getElementsByTagName('textarea');
for (var i = 0, n = txtarea.length; i < n; i++) {
if (txtarea[i].style.resize == 'none') {
txtarea[i].style.resize = 'both';
}
if (txtarea[i].getAttribute('spellcheck') == false) {
txtarea[i].setAttribute('spellcheck', true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment