Skip to content

Instantly share code, notes, and snippets.

@chrisroos
Created February 7, 2014 13:00
Show Gist options
  • Select an option

  • Save chrisroos/8862244 to your computer and use it in GitHub Desktop.

Select an option

Save chrisroos/8862244 to your computer and use it in GitHub Desktop.
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

Copy link
Copy Markdown

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

jobwat commented Nov 15, 2014

Copy link
Copy Markdown

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

skrobul commented Jun 2, 2015

Copy link
Copy Markdown

@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