It would be good to provide an easy way for postMessage clients and servers to
ignore messages not intended for them. The right way to do this is natively with
MessageChannels, but FF doesn't support those and the polyfill from tilde adds a
lot of code we don't want in the TCB.[1]
So, if the config includes a channel value when the client/server is
constructed, include that value as channel when txing and ignore rxed messages
that do not have an identical channel value.
[1] We could use the same technique that we do for tiny-jsonrpc-postmessage,
which is to just implement the protocol w/o the library support in the trusted
code, but that may be complicated.
It would be good to provide an easy way for postMessage clients and servers to
ignore messages not intended for them. The right way to do this is natively with
MessageChannels, but FF doesn't support those and the polyfill from tilde adds a
lot of code we don't want in the TCB.[1]
So, if the config includes a
channelvalue when the client/server isconstructed, include that value as
channelwhen txing and ignore rxed messagesthat do not have an identical channel value.
[1] We could use the same technique that we do for tiny-jsonrpc-postmessage,
which is to just implement the protocol w/o the library support in the trusted
code, but that may be complicated.