We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer.Length always return zero in webview2.
Same code in webview1 returns the correct value.
const Windows = chrome.webview.hostObjects.sync.Windows; const capacity = 10; const buffer = new Windows.Storage.Streams.Buffer(capacity); console.log(buffer.length); // 0
A more practical example to read bytes from a file.
const appRootFolder = Windows.Storage.ApplicationData.current.localFolder; await appRootFolder.createFileAsync('download.txt', Windows.Storage.CreationCollisionOption.openIfExists); const file = await appRootFolder.getFileAsync('download.txt'); await Windows.Storage.FileIO.writeTextAsync(file, "abcdz"); Windows.Storage.FileIO.readBufferAsync(file) .then((buffer) => { const dataReader = Windows.Storage.Streams.DataReader.fromBuffer(buffer); const bytes = new Uint8Array( buffer.length ); console.log(`Buffer length is ${buffer.length}`); console.log(dataReader.readBytes(bytes)); // Manually reading the first 5 bytes instead of using buffer.length const bytes2 = new Uint8Array( 5 ); console.log(dataReader.readBytes(bytes2)); });
Blocking. My app's basic functions are not working due to this issue.
Stable release (WebView2 Runtime)
126.0.2592.81
1.0.2535.41
WinUI2/UWP
Windows 10
No response
No, issue does not reproduce in the corresponding Edge version
No, this never worked
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What happened?
Buffer.Length always return zero in webview2.
Same code in webview1 returns the correct value.
A more practical example to read bytes from a file.
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
126.0.2592.81
SDK Version
1.0.2535.41
Framework
WinUI2/UWP
Operating System
Windows 10
OS Version
No response
Repro steps
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
No, this never worked
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered: