Results 1 to 11 of 11
  1. roninj's Avatar
    129 Posts
    Global Posts
    130 Global Posts
    I am not a developer, yet I think something the Pre really needs is a good ad blocker for the browser. Right now, the browser loads most of a web page's content content immediately, then sits and loads the ads for the site. This normally wouldn't be an issue, but double tapping to auto-zoom in does not stick until a web site is completely loaded.

    So, how feasible would it be to make an ad blocker for the web browser? Initially it could just be a quick hack, but ultimately it would be best if such a program would have the ability to auto-download its own filters. Thoughts?
  2. jsabo's Avatar
    427 Posts
    Global Posts
    479 Global Posts
    Could easily do this on a rooted Pre by updating the hosts file. Should be dozens, if not hundreds, of lists out there.
  3. roninj's Avatar
    129 Posts
    Global Posts
    130 Global Posts
    Thanks. That's another reason to root. Once the warranty issue has been further clarified, and the pricess has become a little more mainstfeamed, I'll take the plunge.
  4. #4  
    Jasbo, esplain preez?
    EDIT: Stupid nonintentional pre puns.
  5. jsabo's Avatar
    427 Posts
    Global Posts
    479 Global Posts
    When you go to a web site, you enter the domain name-- That resolves to an IP address like

    That's currently done using using DNS-- domain name service. Your internet-capable device talks to a DNS server and says "hey, where is at?" If your DNS server knows the answer, it will send it back to you. If not, it will check at a higher level to see who *does* know the answer, and go get it.

    DNS didn't exist when the internet first got started-- there were so few machines that it was possible to manually track them all. This was done with what's know as a host file-- instead of going to a DNS server to see where is at, you would check that file to get the IP address.

    The upshot of all this is that all tcp-IP based devices still use that host file as their first lookup point for addresses.

    There are a variety of reasons why you might do this, but ad blocking is the most common-- I can say "" is really the same IP address as Google, so when it tries to get an ad, the program isn't there, and the ad never appears.

    On windows, the file is in c:\windows\system32\drivers\etc\hosts. Not sure where it is on the Pre, but it should be relatively easy to find & update.

    The hosts files I was seeing online were huge-- around 1.5MB-- which might be a lot for the Pre. What I would do is hit your favorite web pages with a real PC, see where the ads are coming from, then block just those sites.
  6. #6  
    Well, I know where I'm starting for my first app. Thanks for all the detail, I basically understood what I was changing, now I KNOW.
  7. #7  
    Since the Pre runs Linux the hosts file will be at /etc/hosts.
  8. #8  
    Another way to go would be to sent up a proxy on the phone and forward port 80 through it using iptables kinda like this:
    Transparent Proxy as Adblock using Tinyproxy and Dansguardian BroddlIT

    A hosts file manager app would be neat too.
  9. #9  
    ^ Doesnt that run in the background though?? Would be better if it were browser-based.
  10. phwelo's Avatar
    527 Posts
    Global Posts
    553 Global Posts
    Here's a hosts file i found that seems pretty extensive. I'm testing it and it doesn't seem to slow things down at all.
    heres an ipk to make it easier for some:
    for any questions or to send a donation:
  11. #11  
    I used the one from:
    Blocking Unwanted Parasites with a Hosts File

    and it's working well. One point though: if ^M characters at the end of the line bug you (they bug me!), then you can remove them with:

    cat file1 | sed s/.$//g >> file2
    This is a workaround since it appears that the Linux flavor running on the Pre doesn't let you enter <Ctrl-V><Ctrl-M> to produce the ^M. I also received a segfault when trying to read in the new file (:r) in vi.

    Also don't forget to append your new hosts file to your old one (>>) and remove the duplicate " localhost" line from the appended file.

Posting Permissions