You're trying to call postMessage
with an object that has a property referencing arguments
. That doesn't work because data has to be transferable, which means either fully JSON-serializable or implementing Transferable
(e.g. ArrayBuffer), which arguments
is not.
Use Array.prototype.slice.call(arguments, 0)
to convert arguments
into an array, which can be serialized (cloned) if the contents are OK.