IWebView.ExecuteJavaScript() returns a Task<string> with the result of executing the given JavaScript. On Windows and macOS, it computes that result by executing the given JavaScript using the browser's eval() function. However, some web pages actively block the use of eval() via a Content Security Policy (CSP). In versions of 3D WebView prior to v4.3, the JavaScript was completely blocked from executing in that scenario. Starting in v4.3, 3D WebView executes the JavaScript successfully, but it's still unable to return the result. If you encounter this issue and need the result of executing your JavaScript, a workaround is for you to use 3D WebView's message-passing APIs to send the result from JavaScript to your C# script like this:
await webViewPrefab.WaitUntilInitialized();
webViewPrefab.WebView.MessageEmitted += (sender, eventArgs) => {
Debug.Log("Result received: " + eventArgs.Value);
};
await webViewPrefab.WebView.WaitForNextPageLoadToFinish();
webViewPrefab.WebView.ExecuteJavaScript("vuplex.postMessage('page h1:' + document.getElementsByTagName('h1')[0].innerText)");