This page looks best with JavaScript enabled

Websense redirect – My First Chrome Extension

 ·   ·  ☕ 2 min read  ·  ✍️ sathya · 👀... views

At my (current) workplace we have a webfiltering mechanism powered by WebSense. I’ve ranted enough number of times on twitter about websense’s stupid filtering mechanisms & the bizarre classification that it uses to classify websites.

Recently, I found that fetching the mobile(aka text-only) versions of webpages using instapaper/google web transcoder would result in me being able to read the content - which was a very nice alternative because majority of the time, I’d be reading up on posts which are text heavy in nature. It was getting irritating to open to a webpage, encounter a blocked page, open another tab & copy-paste the URL to instapaper to grab the text version. I asked my peers are Super User:

is there a ModRewrite-like extension for chrome ? :-s

TomWij pointed me towards Privoxy but that was not what I needed. So I decided to build a Chrome Extension. The first version of the extension I built fairly quickly, but required manual intervention by way of clicking on the Extension icon to trigger the redirect - clearly not an ideal solution. Taking a deeper look at Chrome Extension API docs, I realized that I needed to build a content script.

Building up on this - I created a simple extension which checks for websense blocking pattern and if so - redirects it to instapaper which then fetches the text-only version. While this extension is not really the best-thing-since-sliced-bread, it’s of immense use to me. (And of course, I learnt to build a Chrome Extension, which I always wanted to do).

There are certain bugs, but I can live with those for the moment. If you need a similar thing - do try out my extension — it’s hosted on my servers & can be downloaded from over here. Let me know if you run into problems.

Share on

Sathyajith Bhat
WRITTEN BY
sathya
Author, AWS Community Hero and DevOps Specialist

What's on this Page