Files
pyscript/pyscript.core/test/shadow-dom.html
2023-06-15 17:08:28 +02:00

39 lines
1.3 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>python</title>
<script>
navigator.serviceWorker.register("../sw.js");
</script>
<link rel="manifest" href="manifest.json" />
<link rel="stylesheet" href="style.css" />
<script defer src="./counter.js"></script>
<script type="module" src="../min.js"></script>
<script type="module">
customElements.define(
"shadow-dom",
class extends HTMLElement {
constructor() {
const sd = super().attachShadow({ mode: "closed" });
sd.appendChild(
Object.assign(document.createElement("script"), {
type: "micropython",
textContent: `
import sys
import js
js.document.currentScript.target.textContent = sys.version
`,
}),
);
}
},
);
</script>
</head>
<body>
<shadow-dom></shadow-dom>
</body>
</html>