HTML Find/Replace before display
|
|
I would like a script that would do a find/replace on HTML before displaying it. There are keywords that I would like to change the color on. I would like to be able to search for "- OPEN -" and change it to "<font>- OPEN -</font>" for example. |
|
|
you can change the "- OPEN -" to "<font>- OPEN -</font>" but you can't do that before the original page is displayed, thats because greasemonkey script only get executed after the page is fully loaded, and when this happens the page is already displayed |
|
|
While voidsenses is technically right, a small script like this should be quick enough that you wouldn't notice the page before it changed, and after it did, you would only see it with different colors. -Joel |
|
|
true, actually i normally only notice the scripts working when the pages are somehow heavy, like full of images to load |
|
|
If you're wanting to do this just for a specific site, you could do something like this: 1. When a page on the site loads, change every link to add a "click" event listener
It's a fairly complicated solution -- a simple, quick search and replace might work just a well -- but something like this would do if you absolutely needed to make the changes before the page is displayed. |
|
|
Brad: that is quite cunning.
|
