Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.
iPhone Newsforums, a part of the
I don't know about most of the over 300,000 of you registered members, but I live in Chicago and spend a lot of time in transit to and fro via...
09-18-2008, 02:34 AM #1
[How To] Block Ads in MobilSafari
I don't know about most of the over 300,000 of you registered members, but I live in Chicago and spend a lot of time in transit to and fro via Chicago's public transportation system – CTA. Now, there are a lot of things I could be doing during this time – blogging for MMi (hey, that's actually the full name now – how cute), colorizing comics for my other job, or, God forbid, some homework, but more often than not I'm reading different websites, following the almighty Obama, or worshiping at the feet of Steve. Even with my Mach Five-esque 16GB on 3G there is one thing that always slows me down – ads.
While I was digging around today on the tubes that are the web, I found James's blog post about ad blocking in MobileSafari, 2.0+. Then I found a couple of guys (on a forum we can't link to for legal reasons) who've found out how to block A LOT more ads you'll encounter while surfing with your phone. The process to get this going is ridiculously easy and should be completely painless:
SSH over to your iPhone (this may work on an iPod Touch as well, but I do not have one to test with, nor do the people who edited this file) and navigate to /etc
copy the file called hosts over to your computer for safekeeping
(I recommend sticking it right next to your backed up MobileInstallation file and your custom firmware)
replace the hosts file on your iPhone with the one provided here – the permissions should already be set right, assuming whatever you decompress the zip with doesn't jack with them. If you'd like to be very sure, chmod 644 the file before you replace the original on the phone.
Surf ad-free until Apple updates the firmware again, at which point you'll probably have to do this again.
For those curious to how this works, a very extensive list of address to block have been added to the hosts file and when MobileSafari is instructed to load them when you visit a page it, well, doesn't.
If you find some other address to block, follow the format in the file and add them.
The Following 24 Users Say Thank You to ajustcircle For This Useful Post:
461am (09-18-2008), creolesoul (10-04-2008), elr0y7 (09-18-2008), jrentzke (09-18-2008), KingLuc (09-19-2008), Knolly (09-18-2008), koolksmart (09-18-2008), lehighkid (01-17-2009), Marecki (09-18-2008), mlsaint78 (10-03-2008), NakedFaerie (09-18-2008), number johnny 5 (01-17-2009), OneRing2Rule (10-01-2008), oo3 (09-18-2008), oscar25 (09-18-2008), ProjectGSX (09-18-2008), qnc (09-19-2008), redeyez69 (09-18-2008), SharpieBandit (09-20-2008), Sixtey7 (09-18-2008), tattoojack (09-18-2008), uvbisani (09-19-2008), Zimoxx (01-03-2009)
09-18-2008, 02:41 AM #2
The Following User Says Thank You to warfa For This Useful Post:
09-18-2008, 03:28 AM #3
Sweet...And it will be like a taco inside a taco within a Taco Bell that's inside a KFC that's within a mall that's inside your dream! Springboard screwy after reboot? Here is the fix
The Following User Says Thank You to Imahottguy For This Useful Post:
09-18-2008, 03:37 AM #4
That's a nice extensive list - thanks!
Well, it seems BigBoss doesn't like this new adblock host file. If you now try & load Categories, it stops with a screen complaining :
Admob blocking has been detected in your hosts file. I have worked many hours on this app. It cannot run with this block in place.
I tried commenting the line out that contained admob, but categories still wouldn't load. I had to delete that line.
This is the line: 127.0.0.1 mm.admob.com
So even though we thought this fix was only for ads in Safari, it also seems to effect anyone using ads in their apps...and bigboss won't have that!
Last edited by jrentzke; 09-18-2008 at 04:37 AM.
09-18-2008, 06:25 AM #5
Been doing this for over a week now. Had to remove admon.com line from host for categories.
The Following User Says Thank You to Nefarious For This Useful Post:
09-18-2008, 07:15 AM #6
BigBoss is one of the best devs on Cydia. I respect his choice and erased the line.
The Following User Says Thank You to bbplayer5 For This Useful Post:
09-18-2008, 07:24 AM #7
good job, great write up. thanks given!
The Following User Says Thank You to tattoojack For This Useful Post:
09-18-2008, 07:31 AM #8
so does this affect other programs, like cycorder?
The Following User Says Thank You to ksiphone For This Useful Post:
09-18-2008, 07:36 AM #9
almighty ObamaI write Mac only tutorials for the iPhone. Check out my iOS 6 and iOS 7 tutorials: modmyphone d o t us
09-18-2008, 08:14 AM #10
- Join Date
- Mar 2008
- Thanked 2 Times in 1 Post
09-18-2008, 08:36 AM #11
The Following User Says Thank You to Eurisko For This Useful Post:
09-18-2008, 08:52 AM #12
The Following User Says Thank You to marcoiac For This Useful Post:
09-18-2008, 09:36 AM #13
The Following User Says Thank You to jimbeam4581 For This Useful Post:
09-18-2008, 10:01 AM #14
hell yeah obama ftw
anyway, thanks for the great tip
The Following User Says Thank You to skatertrash For This Useful Post:
09-18-2008, 10:19 AM #15
Not sure why, but I don't see any ads being blocked after doing this.
nvm...i guess it depends on what sites i go to.
Last edited by oo3; 09-18-2008 at 10:23 AM.
The Following User Says Thank You to oo3 For This Useful Post:
09-18-2008, 12:04 PM #16
spam above. I'll delete when I get to my comp if a mod doesn't beat me to it.
eidt: got it for ya
09-18-2008, 12:07 PM #17
cycorder doesn't give me ads no more ,, MMi ads gone too...but...this is cool but i love MMi, ads and all....will be switching back to ads now~
Last edited by z3r01; 09-18-2008 at 12:11 PM.[IMG]http://img829.imageshack.us/img829/9703/modu.gif[/IMG]
09-18-2008, 12:17 PM #18
sweet can't wait to try this out
09-18-2008, 12:21 PM #19
Are you talking about google ads or pop ups in safari?___________________________________________
09-18-2008, 12:58 PM #20
This makes my safari slower, but most sites w/ ads are gone, EXCEPT MMi. Oh and it's a good way to get an ad-free Cycorder