blob: 3f4788fc1ef936e0d6659a0e759f72e0861b05a6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
async function polyfill() {
const { hydrateShadowRoots } = await import('@webcomponents/template-shadowroot/template-shadowroot.js');
hydrateShadowRoots(document.body);
}
if (
!new DOMParser()
.parseFromString(`<p><template shadowroot="open"></template></p>`, 'text/html', {
includeShadowRoots: true,
})
.querySelector('p')?.shadowRoot
)
polyfill();
|