Monday 3 February 2014

Chrome - Create a button to "proxify" a site

Some time ago I created a custom proxy with the help of this tutorial:
http://www.labnol.org/internet/setup-proxy-server/12890/

Is pretty cool since it helps me circumvent some problems I have from incorrect proxy blacklists, to bypass geographically blocked content, etc.

Recently I found that you can add a bookmark to Chrome that calls some javascript code.

Putting the two together I came up with a simple Button on my Chrome Bookmark bar that instantly redirects a page to my proxy.

All you need to do is to create a bookmark, add it to the bookmark bar and use the following text in the URL (all in a single line!)
:



javascript:window.location="http://PROXY_URL/"+window.location.href.substring(window.location.href.search("://")+3);


Just replace PROXY_URL with your own custom proxy or you can search the for one.

The final bookmark url should look like:


javascript:window.location="http://labnol-proxy-server.appspot.com/"+window.location.href.substring(window.location.href.search("://")+3);


The proxy I mention there is the one that is used as an example in the tutorial link.

So how do you use it?

After adding the bookmark you should be able to see it in the bookmark bar.


When you reach a site that you want to filter to the proxy, just it the button, and It will automatically redirect you:




Of course this means you can do other types of redirections.

I hope you find this useful!

3 comments: