Skip to content

Instantly share code, notes, and snippets.

@luislobo14rap
Last active August 31, 2022 15:11
Show Gist options
  • Save luislobo14rap/0eeb4ff1c67ada1805e80d3553c7a1a6 to your computer and use it in GitHub Desktop.
Save luislobo14rap/0eeb4ff1c67ada1805e80d3553c7a1a6 to your computer and use it in GitHub Desktop.
// jquery-shadow-root.js v1
jQuery.fn.extend({
shadowRoot: function() {
let shadowRoot = $();
$(this).each(function() {
if ($(this)[0].shadowRoot != null) {
shadowRoot = shadowRoot.add($(this)[0].shadowRoot);
};
});
return shadowRoot;
}
});
// jquery-shadowRoot.min.js v1
jQuery.fn.extend({shadowRoot:function(){let a=$();return $(this).each(function(){null!=$(this)[0].shadowRoot&&(a=a.add($(this)[0].shadowRoot))}),a}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment