Skip to content

Instantly share code, notes, and snippets.

@skrobul
Last active July 14, 2018 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skrobul/2803c08fc77ea639d022 to your computer and use it in GitHub Desktop.
Save skrobul/2803c08fc77ea639d022 to your computer and use it in GitHub Desktop.
HSBC UK Individual - Human friendly account names
// ==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 <skrobul@skrobul.com>
// @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);
})();
@sfoubister
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment