Old 07/07/2009, 08:44 PM   #1 (permalink)
Member
 
Join Date: Jun 2009
Posts: 118
Thanks: 23
Thanked 7 Times in 5 Posts
Default How about an ad blocker

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?
roninj is offline   Reply With Quote
Old 07/07/2009, 09:33 PM   #2 (permalink)
Member
 
Join Date: Sep 2003
Posts: 255
Thanks: 11
Thanked 20 Times in 13 Posts
Default

Could easily do this on a rooted Pre by updating the hosts file. Should be dozens, if not hundreds, of lists out there.
jsabo is offline   Reply With Quote
Old 07/07/2009, 09:40 PM   #3 (permalink)
Member
 
Join Date: Jun 2009
Posts: 118
Thanks: 23
Thanked 7 Times in 5 Posts
Default

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.
roninj is offline   Reply With Quote
Old 07/07/2009, 10:35 PM   #4 (permalink)
Member
 
Join Date: Jun 2009
Posts: 259
Thanks: 5
Thanked 14 Times in 15 Posts
Default

Jasbo, esplain preez?
EDIT: Stupid nonintentional pre puns.
The_lane is offline   Reply With Quote
Old 07/08/2009, 01:51 AM   #5 (permalink)
Member
 
Join Date: Sep 2003
Posts: 255
Thanks: 11
Thanked 20 Times in 13 Posts
Default

When you go to a web site, you enter the domain name-- www.google.com. That resolves to an IP address like 128.33.12.129.

That's currently done using using DNS-- domain name service. Your internet-capable device talks to a DNS server and says "hey, where is www.google.com 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 www.google.com 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 "ads.doubleclick.com" 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.
jsabo is offline   Reply With Quote
Thanked By:
Old 07/08/2009, 05:27 AM   #6 (permalink)
Member
 
Join Date: Jun 2009
Posts: 259
Thanks: 5
Thanked 14 Times in 15 Posts
Default

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.
The_lane is offline   Reply With Quote
Old 07/08/2009, 06:17 AM   #7 (permalink)
Homebrew Developer
 
enormous's Avatar
 
Join Date: Dec 2007
Location: D.C. Area
Posts: 151
Thanks: 61
Thanked 30 Times in 13 Posts
Default

Since the Pre runs Linux the hosts file will be at /etc/hosts.
enormous is offline   Reply With Quote
Old 07/08/2009, 07:32 AM   #8 (permalink)
Member
 
Join Date: Jun 2009
Posts: 226
Thanks: 8
Thanked 46 Times in 22 Posts
Default

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.
joshewah is offline   Reply With Quote
Old 07/08/2009, 08:16 AM   #9 (permalink)
Member
 
Join Date: May 2009
Posts: 257
Thanks: 5
Thanked 90 Times in 27 Posts
Default

^ Doesnt that run in the background though?? Would be better if it were browser-based.
peestandingup is offline   Reply With Quote
Old 07/08/2009, 12:28 PM   #10 (permalink)
Member
 
Join Date: Oct 2007
Posts: 528
Thanks: 13
Thanked 16 Times in 11 Posts
Default

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.
http://phwelo.mobi/hosts
heres an ipk to make it easier for some:
http://phwelo.mobi/ipks/hosts.ipk
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

for any questions or to send a donation:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
phwelo is offline   Reply With Quote
Old 07/29/2009, 06:06 PM   #11 (permalink)
Homebrew Developer
 
enormous's Avatar
 
Join Date: Dec 2007
Location: D.C. Area
Posts: 151
Thanks: 61
Thanked 30 Times in 13 Posts
Default

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:

Code:
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 "127.0.0.1 localhost" line from the appended file.
enormous is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 01:39 PM.

Creating smartphone communities
Android Central - Android reviews, news and forums Crackberry - Blackberry news, reviews and community TiPb - iPhone news, accessory reviews & forums
Pre Central - Palm Pre Review, News and Community Treo Central - Treo & Centro News and Forums WMExperts - Windows Mobile Reviews & News

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0