Skip to content

Instantly share code, notes, and snippets.

@maury91
Last active February 10, 2019 02:05
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