Navigate to the following page:
https://www.business.hsbc.co.uk/1/2/bib/username
In their infinite wisdom HSBC have decided to pester their customers with this anti-virus program (Rapport) ad every time the online banking login screen is accessed. Any reason not to download the software is never persisted, making this repetitive process infuriating for millions of UK HSBC customers.
I was wondering if it is possible to write a bookmarklet to load the page and hide the div using a timeout?
I've tried the following but it doesn't seem to execute the script in the setTimeout
block.
javascript:if(window.location!="https://www.business.hsbc.co.uk/1/2/bib/username"){window.location="https://www.business.hsbc.co.uk/1/2/bib/username"};
javascript:(window.setTimeout(function() { document.getElementById("rap_wrapper").style.display = "none"; }, 1000));void(0);
rap_wrapper
is the only element that needs to be removed in the DOM. The setTimeout
is there to give sufficient time for the page to load. But I think this approach is sub-optimum as fire too early on slow connections.
Is there anyway I can use Chrome debugging tools to find the exact function that opens the modal box and kill it there?
Perhaps this is going a little beyond the scope of a simple bookmarklet, so would be happy to write a Chrome Extension instead. Just really trying to understand the best approach at this stage.
EDIT 1:
Bookmarklet is not going to work for this job as the location.href
change will terminate any code that follows (see post here for more info). So I'm guessing a Chrome Extension it is, certainly will be easier, was just looking for a quick and dirty hack.