File tree 3 files changed +19
-2
lines changed
3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 21
21
< script type ="module " src ="/src/index.jsx "> </ script >
22
22
</ body >
23
23
24
- </ html >
24
+ </ html >
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ export function Home() {
110
110
< DemoLinkInput />
111
111
< Uploader />
112
112
< hr />
113
+ < button onClick = { clickeeedd } > Testt</ button >
113
114
< h3 > Test demos</ h3 >
114
115
< ul >
115
116
< li >
@@ -143,3 +144,13 @@ export function Home() {
143
144
</ div >
144
145
);
145
146
}
147
+
148
+ function clickeeedd ( ) {
149
+ console . log ( "fjasklfjklas" )
150
+ window . open ( "/player" , '_blank' ) . focus ( ) ;
151
+ const channel = new BroadcastChannel ( "my-channel" ) ;
152
+ setTimeout ( ( ) => {
153
+ channel . postMessage ( "Hey, how's it going mate? I'm from a different tab!" ) ;
154
+ } , 100 )
155
+
156
+ }
Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ export function PlayerApp() {
15
15
16
16
useEffect ( ( ) => {
17
17
console . log ( "run run run" )
18
+ // subscribe to the same channel, "my-channel"
19
+ const channel = new BroadcastChannel ( "my-channel" ) ;
20
+
21
+ channel . addEventListener ( "message" , e => {
22
+ alert ( e . data )
23
+ } ) ;
18
24
messageBus . listen ( [ 13 ] , function ( msg ) {
19
25
alert ( msg . message )
20
26
} )
@@ -54,7 +60,7 @@ export function PlayerApp() {
54
60
} ) ;
55
61
}
56
62
57
- loadWasm ( ) ;
63
+ // loadWasm();
58
64
} , [ ] )
59
65
60
66
You can’t perform that action at this time.
0 commit comments