View Single Post
Posts: 147 | Thanked: 228 times | Joined on Feb 2010 @ Toronto, Canada
#1
MOD EDIT: One-liner to achieve the same from this post:

Code:
wget -O ~/hosts http://winhelp2002.mvps.org/hosts.txt && echo "127.0.0.1" $(uname -n) "localhost" > /etc/hosts && tr -d '\015' < ~/hosts >> /etc/hosts
---Edit End---

One of the first things I installed on my N900 was adblock. Then when I briefly moved to Android I rooted each and every one of those phones just to install adfree. Notice a trend?

Thanks for all the replies below. Having tried Firefox (fennec), my opinion is that while it works, it is not ready for daily use on the N9. I feel the easiest way to block ads on the N9 is to implement a custom hosts file. It does not require flashing the open mode kernel, and it does survive reboots. This procedure also keeps the correct permissions and file type for the new hosts file (I just checked it on my N9)


I posted the guide in a later post, but here it is again:
_____________________________________________

I implemented an ad blocking hosts file. I've tested some of the sites I usually visit, and all the ads are gone.

Here is a step by step guide how to do it easily.

NOTE: This procedure ONLY works if you've rooted the N9 since you need terminal and root access to /etc.

PC part:

1. Download the latest version of the hosts file TO YOUR PC from:
There are a lot of other versions out there, but this one seems to be updated on a regular basis, the latest version is less than a month old.

2. Open the hosts file in Notepad++, or your favorite text editor. Make sure it is a pure text editor, as some will introduce formatting into the file and they will destroy the hosts file contents.

3. Replace the uncommented first line
127.0.0.1 localhost
with
127.0.0.1 RM696 localhost
This bit seems to be very important on the N9 as others pointed out.

4. Save the new hosts file.

5. Connect the N9 to your PC via USB Mass Storage and copy the new hosts file to it. When you disconnect the N9, the file will be located in
/home/user/MyDocs/
N9 part:

6. Open Terminal and gain root access. The default password is rootme.
devel-su
7. Rename the original N9 hosts file, and keep it as a backup:
mv /etc/hosts /etc/hosts.orig
8. Copy the new hosts file to /etc
cp /home/user/MyDocs/hosts /etc/
9. Enjoy a (mostly) ad free browsing experience on the N9. As I said, some ads may slip through and eventually your hosts file will become obsolete. Getting a new hosts file every once in a while will fix that.

I am sure there are dozens of ways to accomplish this, and the commands I listed use hard paths. That's so it works no matter which folder the Terminal is opened in.

Last edited by thedead1440; 2013-02-18 at 15:17.
 

The Following 13 Users Say Thank You to cr0c0 For This Useful Post: