Gmail Multi-User Login

By Neewb Last update Jun 22, 2008 — Installed 5,174 times. Daily Installs: 2, 2, 1, 2, 2, 5, 3, 4, 4, 7, 6, 5, 2, 10, 5, 2, 4, 1, 2, 8, 5, 7, 5, 2, 4, 10, 3, 10, 5, 1, 2, 7
// ==UserScript==
// @name Gmail Multi-User Login
// @description Dropdown menu of multiple user accounts for Gmail.
// @include http*://www.google.com/accounts/ServiceLogin?service=m*
// @version 1.2
// ==/UserScript==

var users = ['your.mom', 'your.dad', 'your.fish', 'your.sockpuppet']; //add users through the array variable

var target = document.getElementById('Email');

if (target) {

	var dpdwn = document.createElement('select');
	dpdwn.setAttribute('name', 'Email');
	dpdwn.setAttribute('id', 'Email');
	dpdwn.setAttribute('class', 'gaia le val');
	dpdwn.setAttribute('size', '1');
	dpdwn.setAttribute('style', 'width:' + target.offsetWidth + 'px');

	function populate() {
		for (var i = 0; i < users.length; i++) {
			var opt = document.createElement('option');
			opt.setAttribute('value', users[i]);
			var optxt = document.createTextNode(users[i]);
			opt.appendChild(optxt);
			dpdwn.appendChild(opt);
		}
	}
	populate();

	target.parentNode.replaceChild(dpdwn, target);
}

window.getElementByID('Passwd').focus();