Hi, @Ajay Gera. Welcome to Microsoft Q&A.
I ran the program you provided in Visual Studio 2022 Enterprise and Visual Studio 2022 Community, and both ran successfully.
Test.Html
Button Binding JavaScript:
function sendMessage() {
window.chrome.webview.postMessage("Hello from JavaScript!");
}
This seems to be related to your environment. You could consider testing it on other computers to see if the error message also appears, so as to rule out problems in the program.
In the current environment, you need to troubleshoot permissions issues. General direction: 1.Run the program as an administrator 2. adjust the permissions of the target file 3. reset the Edge browser to default settings (reinstall the permissions of the Edge browser) 4. Use a shared folder to store cache files, etc.
Purpose of cached data: This data could help web pages load and run faster.
When created: The UDF is created on startup of the WebView2 host app, if the UDF doesn't exist. Related Documents
What kind of data is stored in the UDF: Related Documents
How to delete and when to delete cached data:Related Documents 1、Related Documents 2
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.