-
-
Save maury91/a549e72de82c4bfef41b537d93bf8e9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const domInsertionObserver = new MutationObserver(function(mutationsList){ | |
const addedPosts = [...mutationsList] | |
.filter(mutation => mutation.type === 'childList' && mutation.addedNodes.length) | |
.flatMap(mutation => [...mutation.addedNodes]) | |
.filter(addedNode => typeof addedNode.id === 'string' && addedNode.id.startsWith('u_fetchstream')) | |
}); | |
domInsertionObserver.observe(document.querySelector('div[id^=feed_stream]'), { childList: true, subtree: true }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment