|
Rank: Member Groups: Member
Joined: 8/11/2015 Posts: 17
|
When I try to read a typed array, I can only see a EO.WebBrowser.JSObject.c How can I access the following array as byte[] ? Quote:return new Uint8Array(10);
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, There is no direct efficient way to do that right now. You would use JSObject's interface to access the length property and then get each elements. For example:
Code: C#
//The JSObject.c you see is derived from JSObject
JSObject jsObj = (JSObject)webView.EvalScript("new Uint8Array(10);");
//Get the array length
int length = (int)jsObj["length"];
//Get the first array item value
int firstItemValue = (int)jsObj[0];
Hope this helps. Thanks!
|
|
Rank: Member Groups: Member
Joined: 8/11/2015 Posts: 17
|
Is there a plan to provide a way for efficiently copying an array to managed world?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
We will look into it. It does make sense to add this since performance is the whole purpose of the TypedArray object.
Thanks!
|
|