Blocking MTNL's annoying ad popups the smart way

Nishant Arora 05/Oct/2014
Facebook
Twitter
LinkedIn
Reddit

Believe me MTNL is a great ISP. If you know where to ring the bell if something goes wrong, it's great. But 2014 onwards they added a great new feature in sync with adphonso. Adphonse is a media company and helps online companies with their online advertising technology. MTNL and adphonso teamed up and started injecting popup ads directly to the page a user requests.

These ads are not popups exactly. They are kinda modal boxes which are injected into the html response generated by the server. This is quite creepy have a look:

 Well, the problem is still greater than this, they have a bad code which is being injected. Bad code seems to break the entire javascript on page. Which means if this ad is loaded when I am browsing facebook, nothing would work because the injected script broke facebook's javascript. The only solution is to refresh the page whenever this ad is encountered.

Trying to block this idiotic attempt by MTNL I browsed through a couple of ways, some of them being "modifying the host files", "setting up the url block feature" in the router, creating registry keys (I use linux, so no registry keys of course). But this does not seem to resolve the issue when I carry my laptop to my friends place who also uses MTNL. I need a one click solution to end this.

Solution: I wrote a chrome extension to block the ad servers for me. Feel free to install the extension for yourselves https://chrome.google.com/webstore/detail/peiimmbcekpjhahehicdkomjnclgfgkg and as always feel free to fork my code http://code.nishantarora.in/mtnl-block-popups

Cheers!
Happy Hacking