Last active
May 30, 2018 16:14
-
-
Save trickpattyFH20/acdadeeda4ad7a62b1441c9627329967 to your computer and use it in GitHub Desktop.
search dom for shadow roots
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
(() => { | |
function walkDom(node, func) { | |
var children = node.childNodes; | |
for (var i = 0; i < children.length; i++) { | |
walkDom(children[i], func); | |
} | |
func(node); | |
} | |
walkDom(document.body, (node) => { | |
if (node.shadowRoot) { | |
console.log(node, node.shadowRoot); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment