WebView2Samples icon indicating copy to clipboard operation
WebView2Samples copied to clipboard

Unity Feature Request: expose AddScriptToExecuteOnDocumentCreatedAsync

Open ptc-ccrabb opened this issue 2 years ago • 2 comments

I would like the ability to inject new globals into webpages I load into the WebView. It appears that CoreWebView2 has such an API at the C++ level: AddScriptToExecuteOnDocumentCreatedAsync. It would be nice if this method were somehow exposed at the C# level in Unity.

ptc-ccrabb avatar Jun 14 '23 14:06 ptc-ccrabb

@michaelfarnsworth @SamiraAtMicrosoft @JordanMandel Does the Unity WebView2 expose the underlying CoreWebView2? I wasn't able to find it if it does. We expose that as a property on the other controls like .NET, so I think it might make sense on the Unity control as well if possible.

champnic avatar Jul 05 '23 17:07 champnic

@champnic we don't currently expose the underlying WebView2 control via the C#, but we've discussed it. I'll revive the topic with the team and see if we can make a plan for this.

michaelfarnsworth avatar Jul 05 '23 18:07 michaelfarnsworth