mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
Otherwise, the remote port will lose its transport and not receive queued messages. The remote port will automatically close anyway when EOF is received on the socket. This allows https://www.tripadvisor.com/ to load, where it instantiates a module by creating a MessageChannel, setting port1's onmessage to the module's instantiation function, posting an undefined message on port2 and then immediately closing port2.
14 lines
404 B
HTML
14 lines
404 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest((done) => {
|
|
const messageChannel = new MessageChannel();
|
|
messageChannel.port1.onmessage = (event) => {
|
|
println(`Port 1 received message: ${event.data}`);
|
|
done();
|
|
};
|
|
messageChannel.port2.postMessage("Hello world!");
|
|
messageChannel.port2.close();
|
|
});
|
|
</script>
|