★ TouchArcade needs your help. Click here to support us on Patreon.

Another revolutionary utility by me: add "find in page" support to most web browsers!

06-19-2009, 09:30 AM
#1
Joined: Dec 2008
Posts: 1,594
Another revolutionary utility by me: add "find in page" support to most web browsers!

Hi guys and gals, hope you'll find my little contribution useful



I’ve long been complaining about the lack of any “find in page” functionality in most mobile Web browsers. Now that I’ve played a bit with JavaScript scriptlets, I can proudly present a working solution to this problem.

All you need to do is, independent of the Web browser you use, add the following favorite:

javascript:var searchText=prompt("Enter the text to search for","");document.body.innerHTML= document.body.innerHTML.replace(new RegExp(searchText,"gi"),"<font size=10 style='color:blue; background-color:yellow;'>"+searchText+"</font>")

You can name it anything and can also safely change the following parameters:
the text “Enter the text to search for”,
10 after size (you can use any number here; the larger the number, the bigger characters it will use)
blue after style and
yellow after background-color (any English color name will do here) to your liking.

After having done this, when you’re on a page where you’d like to search an expression for, just go to Favorites, click / tap this one; in the pop-up dialog, enter the expression to search for and press OK. All the occurrences will be highlighted.

How should you add this favorite?

Click THIS link. (A technical note: the functionality of the scriptlet itself has nothing to do with the go.to website. I’ve only used it as it’s really-really short. I could have used any else Web address; all you need to do is adding a question mark after the address and, after that, copy the scriptlet itself.) After this, depending on your (mobile) platform, do the following:

1. iPhone

1.1 the built-in Safari


a. You’re taken to the website. If you take a look at the URL in the address input field, you’ll see the actual code is still preceded by “go.to free short URL redirect and web forwarding service. Nevertheless, we’ll remove it after adding the favorite.



b. Add it as a standard favorite (press the + icon at the bottom and select Add Bookmark). You can name the new favorite anything; in the screenshot below, I’ve named it “Find txt”:


Tap Done.

c. After having returned to the webpage, go to favorites (tap the “book” icon) and tap the Edit button:



Tap the just-added favorite (here, it’s the second from the top).

d. Go to the second row; now it’s editable, unlike when it was first added. The screenshot below shows the cursor being at the end of the address:



e. Tap and hold the URL area (as you’d do with positioning the cursor in the main address entry field of Safari) and scroll to the beginning of the address, just in front of the “j” of “javascript”. The screenshot below also shows the magnifying glass emphasizing the position of the cursor:



f. Now, on the virtual keyboard, press Delete several times until everything is deleted in front of “javascript”. The URL should be the following:


Tap Done.

g. You’re taken back to the previous Web page. Let’s give our tool a quick try: try to find all occurrences of, say, “Web”. To do this, bring up Favorites again (the “Book” icon) and select “Find txt” – as you’d select a favorite. You’re presented a text entry dialog, where you can directly enter the text to search for and highlight:



h. After pressing OK in the text entry dialog, all occurrences of “Web” have been highlighted:



Pretty nice, eh?
1.2 iPhone with a third-party Web browser

Unfortunately, the following browsers, while they do allow editing URL’s right when you add them, don’t work as expected: Journey Web Browser 1.0 and fgBrowser 2.5. While they do allow saving modded favorites, nothing happens when you click in the first and “The URL can’t be shown” is displayed in the second.

You will want to prefer the built-in find-in-page capabilities of Perfect Browser 1.0, iCab Mobile 1.5 and Air Browser 1.1. (Note that the last two don’t allow for any kind of favorite URL editing at all.)

All in all, I don’t know of any (quality – I haven’t tested the lower-quality ones in this respect; for example, QuickSurf 1.2, Full Screen Web Browser 1.1.1 and Wide Web with Twitter 2.3.1, which all support favorite URL editing) third-party iPhone browser to support this scriptlet (or scriplets at all).

Finally, VanillaSurf 1.2 (my favorite third-party Web browser for iPhone OS 3.0 – too bad it doesn’t support in-page searching; that is, it severely lacks URL editing capabilities) and CaizerWeb 1.0.2 don’t support URL editing and, when passed, direct javascript URL’s in the address field are not accepted. Multi-Full Browser 1.1.0 doesn’t support URL editing either.

Note that, as my iPhone OS 3.0 phone isn’t jailbroken, I couldn’t test whether the manual editing of favorite databases is of any use – as is the case with Internet Explorer Mobile under Windows Mobile.
(Note that the version numbers above reflect the current (06/19/2009) state of all these browsers. By the time you read this, they may have changed.)

2. Windows Mobile

With Internet Explorer Mobile, you’ll need to do a bit of hacking as you can’t save scriplet bookmarks. Don’t be afraid: it’s easier than you may think.

Let’s start with adding any favorite. It can be anything – we’ll delete the URL from it afterwards.

Select Menu / Add to favorites:



Here, I’ve renamed the favorite to “Find txt”. No, don’t try to edit the URL and save the one starting with JavaScript: it’ll show an error:



Instead, on your handset, go to the \Windows\Favorites folder and edit the favorite URL you’ve just created. If you name the favorite “Find txt”, then, the file will be named accordingly; that is, Find txt.url.

In the second row, after “URL=”, just change the previous URL (here: go.to free short URL redirect and web forwarding service) to the new one. Paste the new one. To make your life easier, I recommend the WinCE file system plug-in for Total Commander and doing all this on the desktop.
In the first screenshot below, I’ve shown the to-be-deleted text highlighted; in the second, after replacing it with the above scriplet:




Make sure you store the changed file back to your phone. Now, fire up any Web page you’d like o highlight the occurrences of a word on, go to your favorites and select the finder scriplet. A dialog is displayed:


and click OK (left softkey). The results speak for themselves:




On other operating systems, you will need to do roughly the same – that is, upon saving the favorite, just chop off the leading go.to free short URL redirect and web forwarding service.
06-19-2009, 09:32 AM
#2
Joined: May 2009
Location: Chattanooga, TN
Posts: 510
Send a message via Skype™ to chrisrushing
Wrong section............... man this feels like SPAM.

06-19-2009, 09:38 AM
#3
Joined: May 2009
Location: 加拿大
Posts: 1,239
Heck, this still seems useful though. And with copy/paste function in 3.0, it shouldn't be too hard to use.

Games, games, games..
GameCenter ID: GkCHN
Add me! :]
06-19-2009, 09:39 AM
#4
Joined: Dec 2008
Posts: 1,594
Quote:
Originally Posted by chrisrushing View Post
Wrong section............... man this feels like SPAM.
Yup, sure it isn't a gaming-related post - still, as a LOT of iPhone / Safari users have been asking for the "find in page" functionality for ages, I took the liberty to post it here so that it has the biggest exposure. After all, it's a free trick&tip - I certainly don't make money out of it.
06-19-2009, 09:41 AM
#5
Joined: Dec 2008
Posts: 1,594
Quote:
Originally Posted by GaiaIllusion View Post
Heck, this still seems useful though. And with copy/paste function in 3.0, it shouldn't be too hard to use.
Yup - it works great with copy / paste. (For the favorite to store, however, you don't need copy / paste; it runs on previous OS'es as well as all you need to do to make it work is URL editing, not copy/pasting.)
06-19-2009, 09:42 AM
#6
Joined: Oct 2008
Location: Vancouver, BC
Posts: 1,652
Quote:
Originally Posted by chrisrushing View Post
Wrong section............... man this feels like SPAM.
Why? Because the post is long?

I think it's very useful - thanks for sharing!

 /l、
(゚、
 l、 ~ヽ
 じしf_, )ノ Inconspicuous Group Cat?

Last edited by Mew2468; 06-19-2009 at 09:47 AM.
06-19-2009, 09:44 AM
#7
Joined: Dec 2008
Posts: 1,594
Quote:
Originally Posted by Mew2468 View Post
Because the post is long?
Yup, wanted to explain every single step as, for someone not having ever "installed" a scriptlet on his or her iPhone, URL editing (and the logic of how this is all done) can be overwhelming.
06-19-2009, 09:48 AM
#8
Joined: May 2009
Location: San Francisco, CA
Posts: 884
Using bookmarklets is not new. I've been using them on my iPhone for quite some time now.

The following post was done back in July of 2007, so yeah quite some time ago.

http://www.lifeclever.com/17-powerfu...r-your-iphone/

1) Tried out AT&T tethering and did not have enough money for the pole.
2) Apple still hasn't fixed the no-hardware-keyboard bug.
3) Still can't use the "Cut" function on the AT&T bill...current 4.x issues
06-19-2009, 09:49 AM
#9
Joined: Oct 2008
Location: Vancouver, BC
Posts: 1,652
I was referring to this post that called your post spam:
Quote:
Originally Posted by chrisrushing View Post
Wrong section............... man this feels like SPAM.

 /l、
(゚、
 l、 ~ヽ
 じしf_, )ノ Inconspicuous Group Cat?
06-19-2009, 02:47 PM
#10
Joined: Dec 2008
Posts: 1,594
Quote:
Originally Posted by AttackOfThePwned View Post
Using bookmarklets is not new. I've been using them on my iPhone for quite some time now.

The following post was done back in July of 2007, so yeah quite some time ago.

http://www.lifeclever.com/17-powerfu...r-your-iphone/

Wowz! Thanks for pointing this out! I'll check out how they have implemented this, how they do the synchronization (instead of the manual, URL-editing way I've explained) and will post an update to my guide.