Ad blocking

(Cleanup and expansion)
m (Reverted edits by 92.228.43.162 (Talk) to last revision by joerg_rw)
 
(23 intermediate revisions not shown)
Line 1: Line 1:
-
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.
+
Not only does blocking ads remove their annoyance and distraction, it often frees screen real estate for the actual content that you are trying to read, and depending on the technique used it may also reduce bandwidth usage and CPU load. These are important profits on machines with limited processing power and screen size. There are a number of methods for blocking ads, each with their own set of pros and cons. All of these methods can be combined to create the optimal solution.
-
== Option 1: Privoxy ==
+
== External ==
-
Privoxy is an application that can function, among other things, as an ad filtering proxyserver. That means that instead of directly connecting to the internet you route communication via this application.  
+
Various points in the route from your device to the internet, may provide ad blocking methods. Think about your [http://dd-wrt.com router]/gateway/modem, an external proxy, your internet service provider, and your [http://opendns.org DNS server]. All of these ''may'' provide various levels of filtering, though it is still not common.
 +
 
 +
When available, this is the preferred method, as it has no performance impact on the machine used for browsing.
Pros:
Pros:
-
* Doesn't slow down browsing much
+
* No performance impact on browsing device.
-
* Fairly easy to install
+
Cons:
Cons:
-
* Works only for the saved connections where it is configured
+
* Often less advanced and effective routines.
-
* The ad-blocking settings can only be changed by editing configuration files, although most people won't need to change the defaults. There is an option to be able to edit the configuration via http://config.privoxy.org/  but this is turned off by default because of security risks.
+
* Only available where you can configure elements of your internet route.
-
* May block some applications from network when in use
+
* May be hard to find and configure.
 +
* Blocking is performed at the connection level, so other network applications may be affected.
 +
* It affects everybody that uses the same internet connection (this may also be a advantage)
-
To install do the following:
+
== Hosts file ==
-
* Install the repository that contains 'privoxy' from http://www.gronmayer.com/it/. At the moment of writing the latest version is os2007 ('Bora'), but it works fine in os2008 ('Chinook').
+
The hosts file works by blocking access to a large number of known 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, so you may see warnings about missing pages, images, and scripts. This method can be used in conjunction with the [[#CSS|CSS method]] for element hiding.
-
* install Privoxy from the tablet's application manager. After installing you won't see Privoxy in the menu. It just works in the background while it is installed.
+
-
* Close the network connection on the tablet
+
-
* Go to 'Settings' -> 'Control Panel' -> 'Connectivity' -> 'Connections'
+
-
* Select the connection for which you want to use Privoxy.
+
-
* Click 'Edit', 'Next', 'Next', 'Next', 'Advanced'
+
-
* At the 'Proxies' tab select 'Use Proxy'
+
-
* At 'HTTP proxy' and 'HTTPS proxy' fill in '127.0.0.1'
+
-
* At 'Port Number' under  'HTTP proxy' and 'HTTPS proxy' fill in '8118'
+
-
* click 'Ok', 'Finish','Done', 'Ok'
+
-
* 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.  
+
The rules for these blocks are put into <code>/etc/hosts</code>. Simply append the contents of [http://www.mvps.org/winhelp2002/hosts.htm one of the example hosts files] 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.
-
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 }'.
+
Of particular use in doing this is the program "Advoid", which can be found in one of the repositories.  (Just search the OS2008 downloads and you should find it.)  This program can download the latest hosts file from http://www.mvps.org and update your tablet's hosts file, thus eliminating the need for becoming root and manually editing the hosts file yourself.
-
See also: [http://www.privoxy.org/ www.privoxy.org].
+
Of the device-based solutions, this is the recommended method, as the performance impact of the other methods is non-trivial.
-
== Adblock Plus ==
 
-
Adblock Plus is a plugin for Mozilla based browsers, such as Firefox and the MicroB.
 
Pros:
Pros:
-
* Easy to install.
+
* Lowest performance impact (effectively zero).
-
* Has no influence on other applications than the browser.
+
-
* Is more thorough and effective than the hosts/CSS method.
+
Cons:
Cons:
-
* Significant performance impact that often offsets the benefits of blocking ads.
+
* Less thorough and effective than the other methods.
 +
* Requires having [[root access]] and using XTerm to configure.
 +
* Time consuming to temporarily disable. (See below for a solution)
 +
* The 'hosts' file may block network access from some applications as the rules in it are used by all applications accessing the network.
-
It is available from the Browser Extras repository.
+
== 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, it does however '''not''' prevent the advertisements from downloading. Any of the other solutions on this page can be used to prevent downloading advertisements and save bandwidth. The CSS method does provide very advanced options to adjust the rendering of webpages, for example not only for removing ads but also for adjusting the layout to your internet tablet.
-
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.
+
For an example for such a CSS file, see [http://floppymoose.com Floppymoose.com]. Place this <code>userContent.css</code> file into <code>/home/user/.mozilla/microb/chrome/userContent.css</code> and restart MicroB.
-
== Hosts and CSS ==
+
Pros
-
Editing the 'hosts' and/or 'userContent.css' files.
+
* The most advanced solution for modifying the layout of webpages.
 +
Cons
 +
* Ads are still downloaded, they are just not displayed. So there is no bandwidth saving.
 +
* Complex CSS files may have a performance impact.
 +
 
 +
=== Quick Toggling ===
 +
 
 +
There is now a Perl script to allow you to quickly toggle on and off the hosts and CSS files. Grab [http://www.singingtree.com/~kyle/blog/archives/00000328.htm this hosts_css_toggler.txt] file and rename it to <code>hosts_css_toggler.pl</code> and make it executable. Then just run it as root to toggle the Hosts/CSS method of ad-blocking on and off. You will have to restart the browser for the changes to take effect.  Detailed information and instructions are available on the link provided for the script.
 +
 
 +
== 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.  
Pros:
Pros:
-
* Lowest performance impact (effectively zero).
+
* Lower performance impact than Adblock Plus, but ''may'' be higher than the hosts/CSS combination.
 +
* Fairly easy to install.
 +
* Can perform on-the-fly content modifications, for example to reformat webpages for the smaller screen.
Cons:
Cons:
-
* Less thorough and effective than the other methods.
+
* Small performance impact.
-
* Requires having [[root access]] and using XTerm to configure.
+
* Works only for the saved connections where it is configured.
-
* Time consuming to temporarily disable.
+
* Configuration can be difficult.
-
* The 'hosts' file may block network access from some applications as the rules in it are used by all applications accessing the network.
+
* May block some applications from network when in use.
 +
* Not available on the N900 from the Extras repository
-
=== Hosts ===
+
To install Privoxy:
-
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.
+
# 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.
 +
# Close the network connection on the tablet.
 +
# Go to Settings -> Control Panel -> Connectivity ->Connections
 +
# Select the connection to use Privoxy with.
 +
# Tap 'Edit', 'Next', 'Next', 'Next', 'Advanced'.
 +
# At the 'Proxies' tab select 'Use Proxy'.
 +
# For 'HTTP proxy' and 'HTTPS proxy' use ''127.0.0.1''.
 +
# For 'Port Number' under  'HTTP proxy' and 'HTTPS proxy' use ''8118''.
 +
# Tap 'OK', 'Finish','Done', 'OK'.
 +
# Connect to the network again with the connection you just changed.
-
The rules for these blocks are put into /etc/hosts. Simply append the contents of [http://everythingisnt.com/hosts.html 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.
+
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 <code>/etc/privoxy</code>, the default settings will work for most people. Editing requires root permissions.  
-
=== CSS ===
+
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 <code>/etc/privoxy/user.action</code> and put it under the section ' { -block }'.
-
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.
+
== Adblock Plus ==
 +
 
 +
The popular Mozilla plugin Adblock Plus has been ported to work with MicroB.
 +
 
 +
Pros:
 +
* Easy to install.
 +
* Fairly easy to configure.
 +
* 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.
-
Simply place [http://floppymoose.com this useContent.css] file into /home/user/.mozilla/microb/chrome/userContent.css and restart MicroB.
+
You can save time building up your block list by copying your existing <code>patterns.ini</code> to your tablet here: <code>/home/user/.mozilla/microb/adblockplus</code>. For example, on Windows XP it can be found in <code>C:\Documents and Settings\User\Application Data\Mozilla\Firefox\Profiles\xxxxxxx.default\adblockplus</code>.
 +
Works great in compliment with Flashblock, also available in Browser Extras.
-
[[Category:Users]]
 
[[Category:Web]]
[[Category:Web]]
 +
[[Category:Power users]]

Latest revision as of 12:55, 14 December 2014

Not only does blocking ads remove their annoyance and distraction, it often frees screen real estate for the actual content that you are trying to read, and depending on the technique used it may also reduce bandwidth usage and CPU load. These are important profits on machines with limited processing power and screen size. There are a number of methods for blocking ads, each with their own set of pros and cons. All of these methods can be combined to create the optimal solution.

Contents

[edit] External

Various points in the route from your device to the internet, may provide ad blocking methods. Think about your router/gateway/modem, an external proxy, your internet service provider, and your DNS server. All of these may provide various levels of filtering, though it is still not common.

When available, this is the preferred method, as it has no performance impact on the machine used for browsing.

Pros:

  • No performance impact on browsing device.

Cons:

  • Often less advanced and effective routines.
  • Only available where you can configure elements of your internet route.
  • May be hard to find and configure.
  • Blocking is performed at the connection level, so other network applications may be affected.
  • It affects everybody that uses the same internet connection (this may also be a advantage)

[edit] Hosts file

The hosts file works by blocking access to a large number of known 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, so you may see warnings about missing pages, images, and scripts. This method can be used in conjunction with the CSS method for element hiding.

The rules for these blocks are put into /etc/hosts. Simply append the contents of one of the example hosts files 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.

Of particular use in doing this is the program "Advoid", which can be found in one of the repositories. (Just search the OS2008 downloads and you should find it.) This program can download the latest hosts file from http://www.mvps.org and update your tablet's hosts file, thus eliminating the need for becoming root and manually editing the hosts file yourself.

Of the device-based solutions, 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. (See below for a solution)
  • The 'hosts' file may block network access from some applications as the rules in it are used by all applications accessing the network.

[edit] 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, it does however not prevent the advertisements from downloading. Any of the other solutions on this page can be used to prevent downloading advertisements and save bandwidth. The CSS method does provide very advanced options to adjust the rendering of webpages, for example not only for removing ads but also for adjusting the layout to your internet tablet.

For an example for such a CSS file, see Floppymoose.com. Place this userContent.css file into /home/user/.mozilla/microb/chrome/userContent.css and restart MicroB.

Pros

  • The most advanced solution for modifying the layout of webpages.

Cons

  • Ads are still downloaded, they are just not displayed. So there is no bandwidth saving.
  • Complex CSS files may have a performance impact.

[edit] Quick Toggling

There is now a Perl script to allow you to quickly toggle on and off the hosts and CSS files. Grab this hosts_css_toggler.txt file and rename it to hosts_css_toggler.pl and make it executable. Then just run it as root to toggle the Hosts/CSS method of ad-blocking on and off. You will have to restart the browser for the changes to take effect. Detailed information and instructions are available on the link provided for the script.

[edit] 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 than Adblock Plus, but may be higher than the hosts/CSS combination.
  • Fairly easy to install.
  • Can perform on-the-fly content modifications, for example to reformat webpages for the smaller screen.

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.
  • Not available on the N900 from the Extras repository

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 }'.

[edit] Adblock Plus

The popular Mozilla plugin Adblock Plus has been ported to work with MicroB.

Pros:

  • Easy to install.
  • Fairly easy to configure.
  • 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.