Drux Drux - 1 year ago 100
Javascript Question

What types (next to string) can be passed from JavaScript to Swift inside WKScriptMessage?

I know how to pass strings (e.g. from DOM text nodes) from JavaScript (inside an apps

) to Swift.

What other types are supported? For instance, could I pass DOM elements inside

Answer Source

I have never seen any proper documentation for this. I have successfully put stuff in there that is JSON compatible.

I don't think a DOM element works. But just try it and see what you get back. You may have to turn it into a simpler object first in JavaScript.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download