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
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