The new WKJSScriptingBuffer API allows Swift to define data buffers and make them available to JS code running in a WKWebView.
Is there any API for passing an ArrayBuffer of data from a WKWebView to Swift code? Currently the usual workaround is to convert the buffer to a base64 string, but that is slow and can lead to exhausting memory depending on the size of the buffer.
On the web, window.postMessage() has an argument that allows transferring ownership of ArrayBuffers to the receiver, but the webkit.messageHandlers.<name>.postMessage() API doesn't seem to support that.
Topic:
Safari & Web
SubTopic:
WebKit
1
0
61