Anyone knows how to run javascript in the WebView2 control in WinForms .NET 6.0

WebBrowser, the control that was previously used, is now deprecated as it was using IE, WebView2 uses Edge Chromium, but in WebBrowser you could call the DOM directly in C# so if I just wanted to get the content of a specific I could do it using C# code. Here you need to run the command ExecuteScriptAsync from a WebView2 instance. Nothing worked so far. I recreated new projects and tried while only doing that, still not working.

Also ExecuteScriptAsync().RunSynchronously(); didn’t work for me either.