For my project, I created a Chrome extension that takes every H, T, M, and L that can be (reasonably) pulled from a web page, capitalizes it, and makes it the color green. I chose to emphasize these letters to pay tribute to the HTML behind the web page. I decided to only change the <p>, <h1…6>, <ul>, <li>, and <table> tags; trying to mess with all <div> or <span> tags, even though they might hold text, seriously impacts the performance of your browser.
I tried for a long time to turn every word in a paragraph tag into a hyperlink for that word, but that ended up being pretty complicated. Changing the source HTML without regards to what anomalies are actually underneath will mess with the DOM in unpredictable ways. For example, if someone is using WordPress and has an <img> tag inside their <p> tag….the internet is an unstandardized lawless wasteland. I saved my algorithm for parsing the words from a <p> tag and I’ll probably try it again for a future project. Everything ended up working out because along the way I learned how to use RegExp (regular expressions) for JavaScript which made my current project pretty easy.
It’s a little frustrating that I wrote so many lines of code to only end up with a 4-line function for my finished project, but it just be like that sometimes.
Check out the project on the Chrome Web Store here: link