Last active
July 14, 2018 20:18
-
-
Save skrobul/2803c08fc77ea639d022 to your computer and use it in GitHub Desktop.
HSBC UK Individual - Human friendly account names
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 HSBC Personal - Human friendly account names | |
// @namespace http://github.com/skrobul | |
// @version 0.2 | |
// @description This scripts adds user-friendly names for your HSBC accounts. It can help with managing multiple accounts. | |
// @author skrobul <[email protected]> | |
// @match https://www.services.online-banking.hsbc.co.uk/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
var accountNames = { | |
'40-02-26 12345678': 'Main current', | |
'40-02-26 91234576': 'Education', | |
'40-02-26 12731405': 'Holiday fund', | |
}; | |
function updateNames() { | |
var accounts = document.getElementsByClassName('itemName'); | |
for (var i = 0; i < accounts.length ; i++) { | |
var el = accounts[i]; | |
var origName = el.innerText.trim(); | |
if(accountNames[origName] !== undefined) { | |
el.innerText = el.innerText + " " + accountNames[origName]; | |
} | |
} | |
}; | |
// wait for the Dojo app to be fully initialized. adjust this if needed. defaults to 5 seconds | |
setTimeout(function() { updateNames() }, 5000); | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi This doesn't work for me. Can you give steps to use it? I got your link from the chap who wrote the Business Banking script (https://gist.github.com/chrisroos/8862244).
Thanks!