We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58feb85 commit 631b134Copy full SHA for 631b134
packages/repl/src/lib/Output/devtools/DevTools.svelte
@@ -0,0 +1,31 @@
1
+<script>
2
+ const { iframe } = $props();
3
+
4
+ let devtools_iframe;
5
6
7
+ $effect(() => {
8
+ if (iframe) {
9
+ const iframe_window = iframe.contentWindow;
10
+ iframe_window.addEventListener('preview_ready', () => {
11
+ iframe_window.ChiiDevtoolsIframe = devtools_iframe;
12
+ iframe_window.initialize();
13
+ })
14
15
+ window.addEventListener('message', event => {
16
+ if (typeof event.data === 'string') {
17
+ iframe_window.postMessage(event.data, event.origin);
18
+ }
19
+ });
20
21
22
23
+</script>
24
25
+<iframe title="Svelte Playground" bind:this={devtools_iframe}></iframe>
26
27
+<style>
28
+ iframe {
29
+ border: 0;
30
31
+</style>
0 commit comments