mikerr
Posts: 2781
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

HOWTO setup adblock (for midori and all browsers)

Sat Mar 16, 2013 2:41 pm

Here's how to setup adblocking on your Raspberry Pi

Chromium and Iceweasel support adblock plus, but I find them way too memory/cpu intensive on the Pi to be usable,
and midori has an adblock option which isn't supported in our version on the Pi.

But there is a solution !

You can block all the ads in any browser on the Pi by using a hosts file from the guys at http://winhelp2002.mvps.org
– they maintain an up-to-date host file with a list of ads which we can use.


Open a terminal window and type (or copy and paste) the following:

Code: Select all

wget http://winhelp2002.mvps.org/hosts.txt
sudo mv hosts.txt /etc/hosts
Ads are now gone !

You can stop there and ads are blocked – but you will quickly realise that many sites show an error where the advert used to be.

In step 2 below I'll install a tiny webserver to blank out the ad error pages:
Android app - Raspi Card Imager - download and image SD cards - No PC required !

mikerr
Posts: 2781
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: HOWTO setup adblock (for midori and all browsers)

Sun Jul 07, 2013 1:35 pm

Those error ad pages can be removed by running a local webserver that shows a blank image in their place.

Here's how:

Kwakd – simple webserver to serve blank webpages / images
http://code.google.com/p/kwakd/

We’ll have to download and compile it on the raspberry pi:

Code: Select all

wget http://kwakd.googlecode.com/files/kwakd-0.3.tgz
tar -xvf kwakd-0.3.tgz
cd kwakd-0.3
./configure
make
now we can run it:

Code: Select all

sudo ./kwakd -p 80 &
Ads are now removed, and blank images are served in their place.

Enjoy!

http://www.redrobe.com/mike/setting-up- ... pberry-pi/

Smoking_SD
Posts: 4
Joined: Fri Mar 07, 2014 2:53 pm

Re: HOWTO setup adblock (for midori and all browsers)

Fri Mar 21, 2014 10:52 am

For PC's I use junkbuster / privoxy not tried on raspberry pi yet....

Return to “General discussion”