too many errors when trying to check dom update

This commit is contained in:
khlam 2019-10-19 12:17:57 -07:00
parent 6f614fec62
commit 588e7f6f99

View File

@ -81,25 +81,6 @@ onload = () => {
webview.executeJavaScript(` webview.executeJavaScript(`
document.getElementsByClassName("listItem-2P_4kh")[document.getElementsByClassName("listItem-2P_4kh").length - 1].remove(); document.getElementsByClassName("listItem-2P_4kh")[document.getElementsByClassName("listItem-2P_4kh").length - 1].remove();
const targetNode = document.getElementsByClassName("scroller-2FKFPG firefoxFixScrollFlex-cnI2ix systemPad-3UxEGl scroller-2TZvBN")[0]
const config = { attributes: true, childList: true, subtree: true };
const callback = function(mutationsList, observer) {
for(let mutation of mutationsList) {
if (mutation.type === 'childList') {
console.log('DOM changed');
}
else if (mutation.type === 'attributes') {
console.log('DOM changed');
}
}
};
const observer = new MutationObserver(callback);
observer.observe(targetNode, config);
`) `)
removeBloat(webview) removeBloat(webview)
} }