blob: 603c47743b807ecc00a483d328edcacb7ebb8d57 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<div id=iframe>
<div id=wrapper>
<div id=host>
<template shadowrootmode=open>
<span id=content>Content</span>
</template>
</div>
</div>
</div>
<script>
function sendStatus(error, hasShadow, msg) {
const name = window.name;
parent.postMessage({ name, error, hasShadow, msg }, '*');
}
window.addEventListener('load', () => {
const host = document.querySelector('#host');
if (!host)
return sendStatus(true, false, 'Unable to find host element');
return sendStatus(false, !!host.shadowRoot);
});
</script>
|