Skip to content

Instantly share code, notes, and snippets.

@bo33b
Last active August 29, 2015 14:21
Show Gist options
  • Save bo33b/962c2f2418933ab30918 to your computer and use it in GitHub Desktop.
Save bo33b/962c2f2418933ab30918 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Username Filler
// @namespace bo33b
// @description Fill in a username in any login form
// @downloadURL https://gist.github.com/bo33b/962c2f2418933ab30918/raw/username.user.js
// @include https://accounts.google.com/ServiceLogin*
// @version 1.0
// @grant none
// ==/UserScript==
var id = 'put_your_username_here';
(function fillUsername(id) {
var c = document.getElementsByTagName('input'),
l = c.length,
i = 0,
input = null,
done = false;
for (; i < l; i++) {
input = c[i];
if (input.type == 'text') {
input.focus();
input.value = id;
done = true;
}
if (input.type == 'email') {
input.focus();
input.value = id+'@gmail.com';
done = true;
}
if (done && input.type == 'submit') {
input.click();
}
}
})(id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment