iPhone Pro Tips: Find Text in Safari with Javascript Bookmarklet

Find... in page javascript bookmarklet

If you're browsing the web on a PC, you can just hit CTRL-F or CMD-F and quickly find any text on a webpage. It's great for finding things fast, especially on long reams of text, and Safari does a nice job of it -- just not Mobile Safari on the iPhone, not yet.

Editor emeritus Mike Overbo brought something very similar to us two years ago (along with a ton of others -- check that link!) when iPhone 1.x made bookmarklets all the rage. Since then, Apple has added a lot of functionality, but still hasn't deigned to gift us with Find... on page. Rafael Cimatti (via App Advice) is keeping the handy Javascript bookmarklet alive via Cydia (though it works on any iPhone). It can't fully replace a built in command, with next, back, etc. options, etc. but if it isn't 100% right, it is 100% "right now".

Just bookmark this link on your iPhone: Find...

Either bookmark it on your desktop browser and sync it over, or on your iPhone copy the code after the break, bookmark a random page, edit it, change the name, and paste in the code (check the App Advice link above for step

And next time you're on a page, hit the bookmark, type in your text, and find away!

Have an iPhone Pro Tip of you own to share? Send it in!

[via Daveizzle]

Have something to say about this story? Leave a comment! Need help with something else? Ask in our forums!

Rene Ritchie

EiC of iMore, EP of Mobile Nations, Apple analyst, co-host of Debug, Iterate, Vector, Review, and MacBreak Weekly podcasts. Cook, grappler, photon wrangler. Follow him on Twitter and Google+.

More Posts



← Previously

Browser Wars: Opera Mobile Brings Back "Turbo" Boost to Compete with Safari

Next up →

Shenzhen Worker Commits Suicide over Missing iPhone Prototype - Foxconn Investigating, Apple Comments

Reader comments

iPhone Pro Tips: Find Text in Safari with Javascript Bookmarklet


Very useful little tip. Thanks for that. I had to copy it twice as I don't think I managed to select all the text (fat finger syndrome!)

Hey guys!
What a handy little tip...thanks so much for that, it will make things much easier when searching for particular words! Thanks again!

Great tip. Thanks for that.
Another tip: Download any Webpage or Dokument on the web by pressing a bookmark. Check out "Save My Docs" on the AppStore.

I just became privvy to bookmarklets. So far I only have Twitterific's and Instapaper's (check it out at instapaper.com on your phone). I love these little things!

I've had this since 2.0. This is old school. I thought it was more known. It's a great bookmarklet to have and this should spread it more.

For those of you viewing this on your iPhone,
Copy the following block of code
then create a new bookmark, save it. Now go back and edit it. Paste the above code into where the http:// address is.
Viola! :)

BTW, it might look at if the code goes off the screen, but just drag the selection dots so that they select as a square around the code.

I know this is an old post but if anyone is interested I've mad an updated version of the bookmarklet. The major change is it effectively supports a find next. When you run the bookmarklet a second time on the same page it pre-populates the last search and if you click find again without updating the search term it will move to the next occurrence in the document. This is handy for long documents where it can be difficult to find other search terms.
There are also some fixes to do with multiple finds. With the old bookmarklet if you did a search for Help and then a search for Helping it wouldn't be able to find Helping because of the way it splits up the words when it does the first find. This version also unhighlights old searches when a new search is done.
The block of code for the new bookmarklet is:

The code block above got a bit mangled. The code block below should work:

Thanks for the javascript! The script posted September 15th 2009 worked on iPhone 4S 5.0.1. Yes, best tip!

Or you could just use iOS 5's built-in on-this-page feature. When you're on a page, go to the google search bar, type something in, and scroll to the bottom.