We all know that one of the drawbacks that the Safari browser suffers from in the iPhone (which is in addition to Opera, the two real browsers that work on the iPhone) is the inability to search for texts within these pages, so that if you opened a web page from within Safari on the iPhone and wanted to search For a specific text inside it, instead of reading it all, you will not be able to do that, and you will waste your time reading it or you will close it and head to the laptop.
Well, this problem will be officially surpassed officially by Apple, but next month, with the main update of the number 4.2, which will be available on the iPhone, iPod touch and iPad, but until then you may be in a hurry and want this feature as soon as you depend heavily on the iPhone or iPhone Bad or you will not upgrade immediately to that next update, do not worry, there are always solutions and this time you will not need a jeep break or something similar, but a very simple addition that you make on Safari to enable the search and that in a lame way, but better than nothing.

This add-on comes in the form of what is called a bookmarklet, which is a JavaScript code that performs auxiliary functions in the browser such as search, for example.
- The first step is to copy the following code from the iPhone, and if you are not browsing now from the iPhone, send it to yourself by e-mail and open the e-mail from the iPhone and copy it:
javascript:void%28s%3Dprompt%28%27Find%20text%3A%27%2C%27%27%29%29%3Bs%3D%27%28%27+s+%27%29%27%3Bx%3Dnew%20RegExp%28s%2C%27gi%27%29%3Brn%3DMath.floor%28Math.random%28%29*100%29%3Brid%3D%27z%27%20+%20rn%3Bb%20%3D%20document.body.innerHTML%3Bb%3Db.replace%28x%2C%27%3Cspan%20name%3D%27%20+%20rid%20+%20%27%20id%3D%27%20+%20rid%20+%20%27%20style%3D%5C%27color%3A%23000%3Bbackground-color%3Ayellow%3B%20font-weight%3Abold%3B%5C%27%3E%241%3C/span%3E%27%29%3Bvoid%28document.body.innerHTML%3Db%29%3Balert%28%27Found%20%27%20+%20document.getElementsByName%28rid%29.length%20+%20%27%20matches.%27%29%3Bwindow.scrollTo%280%2Cdocument.getElementsByName%28rid%29%5B0%5D.offsetTop%29%3B
تأكد من نسخه جيدا وبشكل كامل وعدم اغفال أي حرف.
2. The second step, open the Safari browser and go to any website, and add it to your favorites in the browser by pressing the plus button “+” at the bottom of the bar and then choosing “Add a bookmark”

3. On the page that will appear for you, change the name to "Search in Pages", for example, or a name you like, and delete the title in the next field and paste the code that we copied in the first step. (If you are not able to scan the title and paste the code, leave it as it is and save the changes, then return to your favorites in Safari through the book button in the bottom bar, and on the favorites page choose the Edit button, then choose the page that we saved and return the ball by scanning the title and sticking the previous code ).

4. Now when you go to any web page from within Safari on the iPhone and you want to search it, press the Favorites button in the bottom bar (the button that is a book shape) and choose the item that we called "Search in Pages".

5. Then an input box will appear for you, with which you enter the text that you want to search for on this page, and if there are results, it will display its number and mark it in yellow to distinguish it.

Source:
AppAdvice



115 comment