Update: Trubbel’s Utilities 4.2.3#332
Conversation
Trubbel
commented
Oct 19, 2025
- Added: Full-width in directory
- Added: Highlight Messages on Hover
|
@SirStendec can you take a look? |
SirStendec
left a comment
There was a problem hiding this comment.
Hey there, sorry I disappeared for a while. Life's been pretty busy and I just missed this existing.
| } | ||
| }); | ||
|
|
||
| this.observer.observe(document.body, { |
There was a problem hiding this comment.
Please don't attach observers to document.body, especially on active pages like one with chat. If you absolutely need to get this element through raw HTML, you should use elemental which uses a pooled observer alongside shutting that observer down as soon as the necessary element is found.
But more accurately you probably want to use events on the site.chat.scroller ChatScroller fine wrapper? You might be fine just attaching your mouse event handlers to that or override addScrollListeners and removeScrollListeners to add your event(s) there. Twitch calls into that if something causes the HTML element to be recreated, so that should remove any need to hold an observer open.
There was a problem hiding this comment.
Also, though I don't approve of it in general, I do appreciate you removing the observer when the user has the setting disabled.