googlecolab / colab-cdn-widget-manager

Apache License 2.0
22 stars 9 forks source link

Clean comm messages before sending. #11

Closed blois closed 3 years ago

blois commented 3 years ago

Fix for https://github.com/googlecolab/colab-cdn-widget-manager/issues/10

Appears that some libraries may send comm messages with non-transferrable properties, relying on JSON serialization to omit those properties. These messages will throw when sent over an API which requires transferrables, such as a MessageChannel.

This just round-trips messages through JSON.stringify/JSON.parse to omit non-transferrables.