Many web pages would load up a heck of a lot faster on the iPhone's Mobile Safari browser if you weren't stuck waiting for "LOWER YOUR INTEREST RATES NOW" and the like to push through on Mobile Safari. If you've jailbroken your iPhone or iPod touch, however, there's a none-too-hard hack you can make to block a good number of ads from slowing down your page loads. Here's the step-by-step instructions for doing so:
- If you haven't done so already, you'll need to jailbreak your iPhone or iPod touch. We've previously posted guides for doing so in Windows with WinPwn, and with the PwnageTool on a Mac.
- Click the Cydia icon on your jailbroken device. Choose the "Search" function from the bottom, and type in "OpenSSH" (without the quotes) until you can see that package. Click it, choose "Confirm" in the upper-right to install, then re-start your device.
- Once your iPhone/touch reboots, head to Settings, then Wi-Fi, then click the arrow next to the Wi-Fi server you use at home. Write down the IP address. Head back to Settings, choose General, and set Auto-Lock to "Never" (for the time being).
- You'll need an FTP client with SFTP (secure SSH connection over FTP) to connect and trade files with your device. Windows users should try the free FileZilla (which also comes in a no-install portable package), and Mac users' best bet is Cyberduck.
- On your computer, download this replacement hosts.php file from the James is Bored site. Open your FTP client, set it to connect over an SFTP connection, and then put your iPhone/touch's IP address in the "host" section. Your username and password (unless you changed them) are
alpine, respectively. The connection may take a few minutes at first, and you may be asked to accept a host key; say yes to any prompts, and be prepared to try again if the connection fails at first.
- Navigate to to the
/etcfolder at your device's root. Grab the
hosts.phpfile you see there, and place it somewhere secure on your computer (i.e. somewhere it won't get over-written with the James is Bored modified file). This can usually be done in a drag-and-drop fashion.
- Copy the modified
hosts.phpfile to your device and replace the version there. Close your FTP client, and restart your iPhone or iPod touch.
You should start seeing blank spaces or compressed frames where ads used to be. This hack will still leave blank spaces where Flash-based ads would normally be, but display ads from a number of common ad servers should be blocked. If anything important gets blocked, you can easily re-copy your original
hosts.php file back to your device.
I found a few sites—including the New York Times—where the ad-blocking just didn't seem to work, likely because the ads are served through an in-house server. Other places, it worked liked a charm.
Got another method for scaling back ads on your iPhone? Have a better, compatible hosts file to replace the default with? Tell us about it in the comments.