I'm writing a userscript for StackOverflow that has to detect when the user clicks "add a comment". I used a MutationObserver to do this, but since it's connected to
document
it triggers on every single mutation and actually freezes my browser when I open a question with many answers.
Here's a minimal userscript that reproduces the problem.