MicrosoftEdge / WebView2Samples

Microsoft Edge WebView2 samples
830 stars 460 forks source link

Unity Feature Request: expose AddScriptToExecuteOnDocumentCreatedAsync #197

Open ptc-ccrabb opened 1 year ago

ptc-ccrabb commented 1 year ago

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.

champnic commented 12 months ago

@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.

michaelfarnsworth commented 12 months ago

@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.