Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

poiihy

macrumors 68020
Original poster
Aug 22, 2014
2,301
62
I want to make a Tampermonkey userscript that detects the quantity of a certain piece of text in the HTML and displays an alert (or sound or something like that) when the quantity increases. This is for a chat.

So for example, suppose we want to look for "@asdf" and there are zero of them. Then someone writes that and now there is a quantity of one "@asdf"s in the HTML; it displays an alert.

Or suppose there are already some "@asdf"s in the HTML, lets say three. When someone writes one or more "@asdfs" the quantity increases and the script displays an alert.

I don't know much about javascript but I think this should be really simple to do for someone who knows javascript so hopefully you can help me.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.