Replies: 2 comments
-
How to use this ArrayBuffer 4632 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Correct. It only supports javascript as a string. The other overloads are just for generating a string. What you are seeing is expected. There's an open issue to add support #4358 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there an existing issue for this?
CefSharp Version
135.0.170
Operating System
Windows 10
Architecture
x64
.Net Version
net472
Implementation
WinForms
Reproduction Steps
Reference example: CefSharp/CefSharp.Test/Javascript/EvaluateScriptAsyncTests.cs -> CanEvaluateScriptAsyncReturnArrayBuffer
Can only receive ArrayBuffer data returned by Javascript, cannot transfer byte array data to Javascript
Expected behavior
C#:
byte[] bytes = Encoding.UTF8.GetBytes(str); var javascriptResponse = await browser.EvaluateScriptAsync($"putByte({bytes})"); if (javascriptResponse.Success) { var actualBytes = (byte[])javascriptResponse.Result; string newstr = Encoding.UTF8.GetString(actualBytes); Debug.WriteLine(newstr); }
Javascript:
<script> function putByte(pData) { console.log(pData); return pData; } </script>
Actual behavior
error message: Uncaught SyntaxError: Unexpected token ']'\n@ about:blank:1:20"
Regression?
No response
Known Workarounds
No response
Does this problem also occur in the CEF Sample Application
Yes using WinForms command line args
Other information
No response
Beta Was this translation helpful? Give feedback.
All reactions