Skip to content

Instantly share code, notes, and snippets.

@glorpen
Created July 8, 2014 16:36
Show Gist options
  • Save glorpen/e36207839b79bacef01b to your computer and use it in GitHub Desktop.
Save glorpen/e36207839b79bacef01b to your computer and use it in GitHub Desktop.
Creates password input in login form for LastPass support in Alior Bank
// ==UserScript==
// @name AliorBank Helper
// @namespace glorpen
// @include https://aliorbank.pl/hades/do/BANKLOGIN
// @version 1
// @grant none
// ==/UserScript==
/**
* Creates password input for LastPass support in Alior Bank
* @author Arkadiusz Dzięgiel
*/
var oldLogin = document.getElementById("PASSFIELD1").parentNode;
var input = document.createElement("input");
input.style.width = oldLogin.offsetWidth;
oldLogin.style.display = "none";
input.id = "alior-helper";
input.type="password";
oldLogin.parentNode.appendChild(input);
var fields = Array.prototype.slice.call(document.getElementsByClassName("logField"));
input.onchange = function(){
for(var k in fields){
var pos = fields[k].getAttribute("id").substr(9);
fields[k].setAttribute("value", input.value.substr(pos-1,1));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment