Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A simple Greasemonkey style user script to replace account numbers with friendly names in the HSBC business banking user interface
// ==UserScript==
// @name HSBC - Friendly account names
// @namespace http://chrisroos.co.uk/
// @description Replace account numbers with friendly names to help differentiate accounts in HSBC UK Business banking
// @include https://www.business.hsbc.co.uk/*
// ==/UserScript==
(function() {
var accounts = {
'12345678': 'Current account',
'87654321': 'Rainy day'
};
var anchors = document.getElementsByTagName('a');
for (var i = 0; i < anchors.length; i++) {
var anchor = anchors[i];
var anchorTitle = anchor.title;
var r = /Account details for|view a list of recent transactions for|view a list of next working day transactions for/;
if (r.test(anchorTitle)) {
var accountNumber = anchor.innerText;
var accountName = accounts[accountNumber];
anchor.innerText = accountName;
};
};
})()
@janevahn

This comment has been minimized.

Copy link

commented Sep 16, 2014

Hi Chris,
I'm a novice with this stuff - do you have something like this available for regular HSBC banking accounts? The problem isn't just with their business accounts but their regular accounts as well...
Thanks,
jane

@jobwat

This comment has been minimized.

Copy link

commented Nov 15, 2014

Hey Chris,

I also made a userscript to pad the lack of features of HSBC banking site, you could be interested: https://github.com/jobwat/hsbc-account-history-rerender.user.js

Thanks for sharing! :)

@skrobul

This comment has been minimized.

Copy link

commented Jun 2, 2015

@poisonrange: I know your comment is couple months old, but you may be interested in my version of the script that works for regular accounts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.