Tracktion / choc

A collection of header only classes, permissively licensed, to provide basic useful tasks with the bare-minimum of dependencies.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pass ArrayBuffer to webview c-side function?

dbadb opened this issue · comments

When I pass an ArrayBuffer to a webview-bound function (ie via webview->bind("myfunc", []...), choc declares the value to be an object. The object's type is reported as "" and the object has no named members. I see special code in the javascript V8 binding for ArrayBuffers, but this appears to be irrelevant for webview transfers since JSON.stringify is the serialization mechanism in play.

I think there are two potential workarounds: 1. convert the ArrayBuffer to an array, 2: use http post. #1 is certainly not-so-efficient and I've yet to explore #2 fwiw.

I'm guessing this is a known limitation but thought I'd submit this issue to place it on radar screens.

Yes, I was leaving that one until later, as I'm also not sure the best plan!

Here's a related thread I stumbled across - hadn't heard that Photoshop was webview-ing...

https://forums.creativeclouddeveloper.com/t/webview-postmessage-with-arraybuffer-terribly-slow/7055/12