Last active
June 14, 2018 14:24
-
-
Save apparition47/e8671954c614385b78ed9e8b2cde98e6 to your computer and use it in GitHub Desktop.
Shinsei Bank Userscript - Login helper with optional Security Card auto-fill
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Shinsei Bank Helper | |
// @namespace https://gist.github.com/apparition47/e8671954c614385b78ed9e8b2cde98e6 | |
// @version 0.6 | |
// @description Disable Security Keyboard & Optional account/Security Card Login Auto-Fill | |
// @author apparition47 | |
// @match https://*.shinseibank.com/FLEXCUBEAt/LiveConnect.dll* | |
// @match http://www.shinseibank.com/* | |
// @grant none | |
// ==/UserScript== | |
(() => { | |
// -------------------------------- | |
// - START OPTIONAL USER SETTINGS - | |
// -------------------------------- | |
// | |
// OPTIONAL: input your security card for page 2 auto-fill | |
// | |
const secCard = { | |
"A0": "", | |
"B0": "", | |
"C0": "", | |
"D0": "", | |
"E0": "", | |
"F0": "", | |
"G0": "", | |
"H0": "", | |
"I0": "", | |
"J0": "", | |
"A1": "", | |
"B1": "", | |
"C1": "", | |
"D1": "", | |
"E1": "", | |
"F1": "", | |
"G1": "", | |
"H1": "", | |
"I1": "", | |
"J1": "", | |
"A2": "", | |
"B2": "", | |
"C2": "", | |
"D2": "", | |
"E2": "", | |
"F2": "", | |
"G2": "", | |
"H2": "", | |
"I2": "", | |
"J2": "", | |
"A3": "", | |
"B3": "", | |
"C3": "", | |
"D3": "", | |
"E3": "", | |
"F3": "", | |
"G3": "", | |
"H3": "", | |
"I3": "", | |
"J3": "", | |
"A4": "", | |
"B4": "", | |
"C4": "", | |
"D4": "", | |
"E4": "", | |
"F4": "", | |
"G4": "", | |
"H4": "", | |
"I4": "", | |
"J4": "" | |
}; | |
// | |
// OPTIONAL: input your account credentials for page 1 auto-fill | |
// account # (10 digit), pin # (4 digit), password (>6 char) | |
// | |
const accountNo = ""; | |
const pin = ""; | |
const password = ""; | |
// | |
// auto-login (only works if secCard and/or account credentials are filled out) | |
// | |
const autoLogin = true; | |
// ------------------------------ | |
// - END OPTIONAL USER SETTINGS - | |
// ------------------------------ | |
// japanese login link use new seccard-less website when possible | |
window.getURL_jp = () => "https://bk.shinseibank.com/SFC/apps/services/www/SFC/desktopbrowser/default/login?mode=1" | |
const isValidSecCard = (() => { | |
for (var key in secCard) { | |
if ( (`${secCard[key]}`).length !== 1 ) { | |
return false | |
} | |
} | |
return true | |
})(); | |
// uncheck "Use the Security Keyboard" | |
if (document.frmLogonInput && document.frmLogonInput.chksecmod) { | |
document.frmLogonInput.chksecmod.checked = false | |
// pressing RETURN key on a textfield will submit form | |
document.querySelectorAll("input.textfield").forEach(input => { | |
input.addEventListener("keyup", event => { | |
event.preventDefault(); | |
if (event.keyCode === 13) { // RETURN key | |
window.CheckLogonInputs(); // LOGIN button | |
} | |
}); | |
}); | |
// auto-fill if user entered account credentials | |
if (document.frmLogonInput.fldUserID | |
&& document.frmLogonInput.fldUserNumId | |
&& document.frmLogonInput.fldUserPass | |
&& accountNo | |
&& pin | |
&& password | |
) { | |
document.frmLogonInput.fldUserID.value = accountNo; | |
document.frmLogonInput.fldUserNumId.value = pin; | |
document.frmLogonInput.fldUserPass.value = password; | |
if (autoLogin) { | |
window.CheckLogonInputs(); | |
} | |
} | |
} | |
// auto-fill if user entered their security card | |
if (isValidSecCard && window.fldGridChallange1 && window.fldGridChallange2 && window.fldGridChallange3) { | |
document.frmLogonInput.fldGridChg1.value = `${secCard[window.fldGridChallange1]}`.toUpperCase(); | |
document.frmLogonInput.fldGridChg2.value = `${secCard[window.fldGridChallange2]}`.toUpperCase(); | |
document.frmLogonInput.fldGridChg3.value = `${secCard[window.fldGridChallange3]}`.toUpperCase(); | |
if (autoLogin) { | |
window.CheckLogonInputs(); | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment