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.
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.