Fix chat scrolling with Dark Reader extension

This commit is contained in:
oobabooga 2023-08-27 14:53:42 -07:00
parent b2296dcda0
commit 0986868b1b

View File

@ -73,7 +73,8 @@ const targetElement = document.getElementById('chat').parentNode.parentNode.pare
// Create a MutationObserver instance // Create a MutationObserver instance
const observer = new MutationObserver(function(mutations) { const observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) { 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; childElement.scrollTop = childElement.scrollHeight;
}); });
}); });