serenity/Base/res/html/misc/message-channel.html
Andreas Kling 95559c4277 LibWeb: Implement basic support for MessageChannel and MessagePort
This patch adds a basic initial implementation of these API's.

Since LibWeb currently doesn't support workers, this implementation of
messaging doesn't bother with serializing and deserializing messages.
2021-09-19 22:34:44 +02:00

8 lines
200 B
HTML

<script>
var channel = new MessageChannel();
channel.port2.onmessage = function(event) {
console.log("Port2 received '" + event.data + "'");
}
channel.port1.postMessage("HELLO FRIEND");
</script>