+ Reply
Page 1 of 5 123 ... LastLast
Results 1 to 20 of 97

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: [How To] Block Ads in MobilSafari

is a discussion within the

iPhone News

forums, a part of the

General iPhone

section;
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
...
  1. #1
    iPhone? More like MyPhone
    Join Date
    Jul 2007
    Location
    chicago
    Posts
    127
    Thanks
    4
    Thanked 34 Times in 7 Posts

    Default [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:

    Step One
    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

    Step Two
    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)

    Step Three
    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.

    Step Four
    reboot

    Step Five
    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.
    Attached Thumbnails Attached Thumbnails [How To] Block Ads in MobilSafari-adfree.png  

  2. 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)

  3. #2
    What's Jailbreak?
    Join Date
    Sep 2007
    Posts
    16
    Thanks
    2
    Thanked 2 Times in 2 Posts

    awesome! thankx

  4. The Following User Says Thank You to warfa For This Useful Post:

    koolksmart (09-18-2008)

  5. #3
    I'm not a star Imahottguy's Avatar
    Join Date
    Jul 2007
    Location
    MI, USA
    Posts
    2,440
    Thanks
    92
    Thanked 164 Times in 143 Posts

    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

  6. The Following User Says Thank You to Imahottguy For This Useful Post:

    koolksmart (09-18-2008)

  7. #4
    iPhoneaholic jrentzke's Avatar
    Join Date
    Sep 2007
    Posts
    425
    Thanks
    74
    Thanked 55 Times in 40 Posts

    That's a nice extensive list - thanks!

    [edit]
    Well, it seems BigBoss doesn't like this new adblock host file. If you now try & load Categories, it stops with a screen complaining :

    Permissions Error

    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.

  8. The Following 2 Users Say Thank You to jrentzke For This Useful Post:

    elr0y7 (09-18-2008), koolksmart (09-18-2008)

  9. #5
    iPhoneaholic Nefarious's Avatar
    Join Date
    Nov 2007
    Posts
    311
    Thanks
    30
    Thanked 26 Times in 22 Posts

    Been doing this for over a week now. Had to remove admon.com line from host for categories.

  10. The Following User Says Thank You to Nefarious For This Useful Post:

    koolksmart (09-18-2008)

  11. #6
    iPhone? More like MyPhone bbplayer5's Avatar
    Join Date
    Sep 2007
    Posts
    295
    Thanks
    4
    Thanked 23 Times in 17 Posts

    BigBoss is one of the best devs on Cydia. I respect his choice and erased the line.

  12. The Following User Says Thank You to bbplayer5 For This Useful Post:

    koolksmart (09-18-2008)

  13. #7
    My iPhone is a Part of Me
    Join Date
    Nov 2007
    Location
    Los Angeles
    Posts
    815
    Thanks
    417
    Thanked 108 Times in 80 Posts

    good job, great write up. thanks given!

  14. The Following User Says Thank You to tattoojack For This Useful Post:

    koolksmart (09-18-2008)

  15. #8
    iPhone? More like MyPhone
    Join Date
    Jul 2008
    Location
    right in the middle of the US
    Posts
    140
    Thanks
    4
    Thanked 7 Times in 5 Posts

    so does this affect other programs, like cycorder?

  16. The Following User Says Thank You to ksiphone For This Useful Post:

    koolksmart (09-18-2008)

  17. #9
    My iPhone is a Part of Me exNavy's Avatar
    Join Date
    Jun 2007
    Location
    Arizona
    Posts
    996
    Thanks
    56
    Thanked 159 Times in 118 Posts

    almighty Obama
    I write Mac only tutorials for the iPhone. Check out my iOS 6 and iOS 7 tutorials: modmyphone d o t us

  18. The Following 3 Users Say Thank You to exNavy For This Useful Post:

    koolksmart (09-18-2008), Kyle Matthews (09-18-2008), SharpieBandit (09-20-2008)

  19. #10
    What's Jailbreak?
    Join Date
    Mar 2008
    Posts
    1
    Thanks
    0
    Thanked 2 Times in 1 Post
    Quote Originally Posted by ksiphone View Post
    so does this affect other programs, like cycorder?
    This will effect any program that uses the hosts file which means anything that does HTTP connections. You can add these to your computers hosts file and block ads in any browser. On a PC it did strange things to IE when accessing CNN though.

  20. The Following 2 Users Say Thank You to smoketx For This Useful Post:

    koolksmart (09-18-2008), uvbisani (09-19-2008)

  21. #11
    Livin the iPhone Life Eurisko's Avatar
    Join Date
    Aug 2007
    Location
    Toronto, Canada
    Posts
    3,308
    Thanks
    12
    Thanked 562 Times in 483 Posts

    Quote Originally Posted by bbplayer5 View Post
    bigboss is one of the best devs on cydia. I respect his choice and erased the line.
    lol
    Get "iPod & iTunes for Dummies", it'll change your life.

  22. The Following User Says Thank You to Eurisko For This Useful Post:

    koolksmart (09-18-2008)

  23. #12
    iPhone? More like MyPhone
    Join Date
    Nov 2007
    Posts
    269
    Thanks
    22
    Thanked 16 Times in 16 Posts

    Quote Originally Posted by smoketx View Post
    This will effect any program that uses the hosts file which means anything that does HTTP connections. You can add these to your computers hosts file and block ads in any browser. On a PC it did strange things to IE when accessing CNN though.
    Where is hosts on a Mac? I looked for it and could not find it

    EDIT: never mind, found it, it's obviously in /etc
    Last edited by marcoiac; 09-18-2008 at 09:00 AM.
    iPhone 2G Pwned 3.1.2
    MBP OSX 10.6.3

  24. The Following User Says Thank You to marcoiac For This Useful Post:

    koolksmart (09-18-2008)

  25. #13
    Green Apple
    Join Date
    Dec 2007
    Posts
    84
    Thanks
    0
    Thanked 10 Times in 8 Posts

    Quote Originally Posted by jrentzke View Post
    That's a nice extensive list - thanks!

    [edit]
    Well, it seems BigBoss doesn't like this new adblock host file. If you now try & load Categories, it stops with a screen complaining :

    Permissions Error

    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!
    Thats because he has ads in his app now.

  26. The Following User Says Thank You to jimbeam4581 For This Useful Post:

    koolksmart (09-18-2008)

  27. #14
    Green Apple
    Join Date
    Apr 2008
    Posts
    39
    Thanks
    7
    Thanked 4 Times in 4 Posts

    hell yeah obama ftw

    anyway, thanks for the great tip

  28. The Following User Says Thank You to skatertrash For This Useful Post:

    koolksmart (09-18-2008)

  29. #15
    oo3
    oo3 is offline
    iPhoneaholic oo3's Avatar
    Join Date
    May 2008
    Location
    Beaverton, OR
    Posts
    474
    Thanks
    89
    Thanked 61 Times in 48 Posts

    Not sure why, but I don't see any ads being blocked after doing this.

    *EDIT*

    nvm...i guess it depends on what sites i go to.
    Last edited by oo3; 09-18-2008 at 10:23 AM.

  30. The Following User Says Thank You to oo3 For This Useful Post:

    koolksmart (09-18-2008)

  31. #16
    Owner / Founder - ModMyi
    aka poetic_folly
    Kyle Matthews's Avatar
    Join Date
    May 2007
    Location
    Tampa, Florida, United States
    Posts
    8,458
    Thanks
    562
    Thanked 4,750 Times in 1,210 Posts

    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

  32. #17
    apatia z3r01's Avatar
    Join Date
    Jul 2007
    Location
    Brooklyn
    Posts
    5,696
    Thanks
    82
    Thanked 886 Times in 557 Posts

    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]

  33. #18
    Green Apple
    Join Date
    Mar 2008
    Posts
    72
    Thanks
    7
    Thanked 2 Times in 2 Posts

    sweet can't wait to try this out

  34. #19
    iPhone? More like MyPhone mtwiford's Avatar
    Join Date
    Sep 2007
    Posts
    297
    Thanks
    8
    Thanked 48 Times in 35 Posts

    Are you talking about google ads or pop ups in safari?
    ___________________________________________

    ......epic

  35. #20
    iPhone? More like MyPhone
    Join Date
    Dec 2007
    Location
    Chicago, IL
    Posts
    263
    Thanks
    10
    Thanked 35 Times in 16 Posts

    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

+ Reply
Page 1 of 5 123 ... LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts