From 0986868b1b4d1115534917d187a3b2c03ab042e2 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 27 Aug 2023 14:53:42 -0700 Subject: [PATCH] Fix chat scrolling with Dark Reader extension --- js/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 4544460e..bccdd346 100644 --- a/js/main.js +++ b/js/main.js @@ -73,7 +73,8 @@ const targetElement = document.getElementById('chat').parentNode.parentNode.pare // Create a MutationObserver instance const observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { - let childElement = targetElement.childNodes[2].childNodes[0].childNodes[1]; + let nodes = targetElement.childNodes[2].childNodes[0].childNodes; + let childElement = nodes[nodes.length - 1]; childElement.scrollTop = childElement.scrollHeight; }); });