First off, I'm not even sure this utility request would be qualified as a "Coding Snack," but hey, what do I know? So, here's hoping!
There are numerous "Find In Page Search" (FIPS) utilities available. My need is for a FIPS which will find all character strings, but instead of searching for a single string the "Find All In Page Search" (FAIPS) would need to find all items from a list on the page. Here are some specifics...
- The purpose is for research. Essentially, the researcher would populate an "Always On Top," floating and resize-able "word list" box to take to candidate websites and execute the search which would locate any/all hits.
- A "No Hits On Page" pop-up message box if no words from the list are found.
- The word list would need to have at least 100 user-entered words to search, but for the prototype we can use 10 words to test the function. The candidate resources are very long.
- All hits would need to have persistent background highlights.
- Highlight color would be user-configurable. Different websites use different colors.
- "Select All" button to highlight all hits for all words in the word list.
- If a word in the list were selected each hit for that word would be the only hit(s) highlighted.
- "Find First" button to locate the first hit on the website.
- "Find Next" button to locate the next hit.
The effect would be like doing a word search once instead of a 100 different "Find In Page" word searches. I have no idea how feasible it would be to make this work and I would understand why no one would want to tackle it, but I thought I would ask anyway.
I will be trying to make this work myself, but the outcome is dubious. I used to be a fair programmer, but nowadays, eh not so much. I have looked into AHK and have submitted a request for help, but there are some pretty sharp folks on DC too!
I am thinking the first thing I need to do is to make a working copy of the webpage itself. It is the only way I can think of to write additional HTML which I believe the highlighting would need. I also suspect there would have to be a recursive function for each word searched from the list which seems like each successive search would have to re-write the HTML before going to the next word in the list. If there is an easier way I am not aware of it. Anyway, any assistance would be appreciated.
Please let me know if I can be of any help clarifying, etc.