Fix chat scrolling with Dark Reader extension
This commit is contained in:
parent
b2296dcda0
commit
0986868b1b
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue