Ad blocking

m (Privoxy)
m (Privoxy)
Line 25: Line 25:
== Privoxy ==
== Privoxy ==
-
{{main|privoxy}}
+
{{main|Privoxy}}
[http://www.privoxy.org Privoxy] is an application that can function, among other things, as an ad filtering proxy server. That means that instead of directly connecting to the internet the connection is filtered through Privoxy, which cleanses it of advertising.  
[http://www.privoxy.org Privoxy] is an application that can function, among other things, as an ad filtering proxy server. That means that instead of directly connecting to the internet the connection is filtered through Privoxy, which cleanses it of advertising.  

Revision as of 21:18, 22 January 2009

Not only does blocking ads remove their annoyance and distraction, it also reduces bandwidth usage and decreases CPU load. This can decrease page loading and rendering time, and reduce memory usage, especially on slower connections. There are a number of methods for blocking ads, each with their own set of pros and cons.

Contents

Hosts and CSS

This is the recommended method, as the performance impact of the other methods is non-trivial.

Pros:

  • Lowest performance impact (effectively zero).

Cons:

  • Less thorough and effective than the other methods.
  • Requires having root access and using XTerm to configure.
  • Time consuming to temporarily disable.
  • The 'hosts' file may block network access from some applications as the rules in it are used by all applications accessing the network.

Hosts

The hosts file works by blocking access to a large number of know advertising servers, thus preventing the browser from loading content from those servers. Although the hosts file prevents advertising content from being loaded, it does not remove those elements from the page. Which is why it is used in conjunction with the CSS method.

The rules for these blocks are put into /etc/hosts. Simply append the contents of this hosts file to the end of your hosts file. To edit it you need root access. Be careful to add it to the existing contents instead of overwriting them, as these are necessary for normal operation of the tablet.

CSS

The CSS method uses a custom stylesheet that the browser will apply to all pages. This stylesheet has rules for removing advertising elements from the page. So the hosts file prevents the content from being loaded, and the CSS stylesheet prevents the elements from being rendered.

Simply place this userContent.css file into /home/user/.mozilla/microb/chrome/userContent.css and restart MicroB.

Privoxy

Main article: Privoxy

Privoxy is an application that can function, among other things, as an ad filtering proxy server. That means that instead of directly connecting to the internet the connection is filtered through Privoxy, which cleanses it of advertising.

Pros:

  • Lower performance impact that Adblock Plus, but higher than hosts/CSS.
  • Fairly easy to install.

Cons:

  • Small performance impact.
  • Works only for the saved connections where it is configured.
  • Configuration can be difficult.
  • May block some applications from network when in use.

To install Privoxy:

  1. Make sure Extras is enabled and install Privoxy from the Application Manager. After installing you won't see Privoxy in the menu. It just works in the background while it is installed.
  2. Close the network connection on the tablet.
  3. Go to Settings -> Control Panel -> Connectivity ->Connections
  4. Select the connection to use Privoxy with.
  5. Tap 'Edit', 'Next', 'Next', 'Next', 'Advanced'.
  6. At the 'Proxies' tab select 'Use Proxy'.
  7. For 'HTTP proxy' and 'HTTPS proxy' use 127.0.0.1.
  8. For 'Port Number' under 'HTTP proxy' and 'HTTPS proxy' use 8118.
  9. Tap 'OK', 'Finish','Done', 'OK'.
  10. Connect to the network again with the connection you just changed.

Now this connection uses Privoxy and ads should be blocked. For each saved connection with which you want to use Privoxy you need to edit the proxy settings as shown above. Although you can change the ad-blocking settings by editing the configuration files in /etc/privoxy, the default settings will work for most people. Editing requires root permissions.

It is possible that Privoxy stops some applications from connecting to the network as all applications are now forced to go via Privoxy for http and https access. The Wayfinder Map application for example cannot download maps via a connetion with Privoxy. A simple solution is to make another network connection via Settings that does not use Privoxy and switch between them when necessary. Or, if you know the exact domain(s) the application tries to access, you could add the domain to Privoxy's whitelist. To do so edit /etc/privoxy/user.action and put it under the section ' { -block }'.

Adblock Plus

Adblock Plus is a plugin for Mozilla based browsers, such as Firefox and the MicroB.

Pros:

  • Easy to install.
  • Has no influence on other applications than the browser.
  • Is more thorough and effective than the hosts/CSS method.

Cons:

  • Significant performance impact that often offsets the benefits of blocking ads.

It is available from the Browser Extras repository.

You can save time building up your block list by copying your existing patterns.ini to your tablet here: /home/user/.mozilla/microb/adblockplus. For example, on Windows XP it can be found in C:\Documents and Settings\User\Application Data\Mozilla\Firefox\Profiles\xxxxxxx.default\adblockplus.

Works great in compliment with Flashblock, also available in Browser Extras.