At work they have implemented the WebSense Internet filter.

This doesn’t bother me to much as most of the websites that I frequent are not on the black list and so it doesn’t interfere to much but there are exceptions. No social networking pages are available and also certain blogs are tagged as personal/blogging and so blocked.

To circumvent this annoyance I have been using labnol.orgs’ brilliant  proxy that can be hosted at google apps, mine is for those currently frustrated at work.

This has been working fine for me but it got annoying seeing the page below, copying the address it displayed opening my proxy and pasting the address:

So Aaron and myself set out to automate the procedure which resulted in the following javascript:

javascript:var myIFrame = window.frames[0].document.getElementById('url-text').innerHTML; window.location("<a href=""></a>" + myIFrame.substr(7) );

I’ve saved this as a bookmark in Internet Explorer and so when I get the blocked screen all I have to do is hit the bookmark icon and I’m redirected to the website via my proxy.

There is not much to brake down about the code the hardest part was:

var myIFrame = window.frames[0].document.getElementById('url-text').innerHTML

The difficult being we hadn’t realised that the page we saw was an amalgamation of two iFrames and so rather than searching for document.getElementById(‘url-text’) directly we had to specify the frame to search in first hence window.frames[0].

window.location("<a href=""></a>" + myIFrame.substr(7) );

This line of code takes the link we’ve taken from the page and points my browser to it with the http:// removed and replaced with my proxy address.

I hope someone else can benefit from this nice little bookmark hack.