Editing Ad blocking

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
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.
+
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.
-
== External ==
+
== Option 1: Privoxy ==
-
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.
+
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.  
-
 
+
-
When available, this is the preferred method, as it has no performance impact on the machine used for browsing.
+
Pros:
Pros:
-
* No performance impact on browsing device.
+
* Doesn't slow down browsing much
 +
* Fairly easy to install
Cons:
Cons:
-
* Often less advanced and effective routines.
+
* Works only for the saved connections where it is configured
-
* Only available where you can configure elements of your internet route.
+
* 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.
-
* May be hard to find and configure.
+
* May block some applications from network when in use
-
* 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)
+
-
== Hosts file ==
+
To install do the following:
-
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 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').
 +
* 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
-
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.
+
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.  
-
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.
+
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 the device-based solutions, this is the recommended method, as the performance impact of the other methods is non-trivial.
+
See also: [http://www.privoxy.org/ www.privoxy.org].
 +
== Adblock Plus ==
 +
Adblock Plus is a plugin for Mozilla based browsers, such as Firefox and the MicroB.
Pros:
Pros:
-
* Lowest performance impact (effectively zero).
+
* Easy to install.
 +
* Has no influence on other applications than the browser.
 +
* Is more thorough and effective than the hosts/CSS method.
Cons:
Cons:
-
* Less thorough and effective than the other methods.
+
* Significant performance impact that often offsets the benefits of blocking ads.
-
* 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.
+
-
== CSS ==
+
It is available from the Browser Extras repository.
-
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 [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.
+
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.
-
Pros
+
== Hosts and CSS ==
-
* The most advanced solution for modifying the layout of webpages.
+
Editing the 'hosts' and/or 'userContent.css' files.
-
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:
-
* Lower performance impact than Adblock Plus, but ''may'' be higher than the hosts/CSS combination.
+
* Lowest performance impact (effectively zero).
-
* Fairly easy to install.
+
-
* Can perform on-the-fly content modifications, for example to reformat webpages for the smaller screen.
+
Cons:
Cons:
-
* Small performance impact.
+
* Less thorough and effective than the other methods.
-
* Works only for the saved connections where it is configured.
+
* Requires having [[root access]] and using XTerm to configure.
-
* Configuration can be difficult.
+
* Time consuming to temporarily disable.
-
* May block some applications from network when in use.
+
* The 'hosts' file may block network access from some applications as the rules in it are used by all applications accessing the network.
-
* Not available on the N900 from the Extras repository
+
-
To install Privoxy:
+
=== Hosts ===
-
# 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.
+
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.
-
# 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.
+
-
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.  
+
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.
-
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 }'.
+
=== CSS ===
-
== Adblock Plus ==
+
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.
-
 
+
-
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 <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>.
+
Simply place [http://floppymoose.com this useContent.css] file into /home/user/.mozilla/microb/chrome/userContent.css and restart MicroB.
-
Works great in compliment with Flashblock, also available in Browser Extras.
 
 +
[[Category:Users]]
[[Category:Web]]
[[Category:Web]]
-
[[Category:Power users]]
 

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: