AutoLogin GreaseMonkey Script

Here is a GreaseMonkey Script that changes the languages options on the PeopleSoft login page to users’ names.  When you click on the user’s name, it populates the username and password.  It is great for when you are testing Workflow or something like that.

// ==UserScript==
// @name           PSautologin
// @namespace
// @description    Automatic Login for PS
// @include        http://ps_server:*/psp/*/EMPLOYEE/ERP/?cmd=logout
// @include        http://ps_server:*/psp/*/?cmd=login*
// @include        http://ps_server:*/psp/HR90CNV/*/HRMS/?cmd=logout
// ==/UserScript==

// set up jQuery variable
var $;

// Add jQuery
var GM_JQ = document.createElement("script");
GM_JQ.src = "";
GM_JQ.type = "text/javascript";


// Check if jQuery's loaded
var checker=setInterval(function(){
if(typeof ($ = unsafeWindow.jQuery) != "undefined") {

// All your GM code must be inside this function
function letsJQuery() {
var selectALanguage = $('.pslanguageframe .psloginlabel:contains("Select a Language")');
selectALanguage.text("Select A User:");
$('.pslanguageframe .pslogintext').toggleClass('skpremove');
$('.pslanguageframe .pslogintext').text("Hello");
$('.pslanguageframe .textnormal').remove();
$('.pslanguageframe .pslogintext:first').text("test");
addUser('PS', 'PS');
addUser('VP1', 'VP1');
$('.pslanguageframe .skpremove').remove();

$('table:first table:first > tbody > tr:eq(1) td').html('<a href="http://serverWithList/">Other Instances</a>');

function addUser(userName, password) {
var newLink = $('.pslanguageframe .skpremove:first').html("<a href='javascript:login'>" + userName + "</a>").toggleClass('skpremove').children('a');
newLink.attr('userName', userName);
newLink.attr('password', password);;

function loginwith() {
userName = $(this).attr('userName');
password = $(this).attr('password');


// don't trigger URL for link
return false;

2 Responses to “AutoLogin GreaseMonkey Script”

  1. Rick Conklin Says:

    Great work! And great idea for a GreaseMonkey script!

    I hope you don’t mind, but I’ve taken your lead, and added a few enhancements. Instead of hard-coding credentials in the script, I capture them during log-in and prompt to store new credentials. (These are stored in an environment-specific cookie.)

    I also added support for PeopleTools 8.47. Because the the page’s HTML is slight different, the jQuery selectors in the above code didn’t find their targets.


    View source code:

  2. digitaleagle Says:


    This is really great. I haven’t had the chance to try it out myself, but I hope to create a new post to bring more attention to your changes.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: