MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
452 stars 55 forks source link

WebView2 on UWP without WinUI3 is here! What's next ? #1559

Closed pfresnay closed 1 year ago

pfresnay commented 3 years ago

Hi, I tried to build a "classic" UWP .net native app with latest webview2 prerelease package, and it works now! Only CompositionController seems to work now, render on a LayoutVisual and redirect mouse & pointer events manually.

It's really a great news regarding UWP+WinUI3 latest announcement: we can now wait until WinUI3 is ready to fully replace UWP XAML stack (Media controls, InkCanvas, Map, etc.)

Can you give us more details regarding what will happen next ?

Current code that i'm using:

env = await CoreWebView2Environment.CreateAsync();

wr = CoreWebView2ControllerWindowReference.CreateFromCoreWindow(CoreWindow.GetForCurrentThread());
c = await env.CreateCoreWebView2CompositionControllerAsync(wr);

c.SetBoundsAndZoomFactor(new Rect(0, 0, grid.ActualWidth, grid.ActualHeight), 1);
c.CoreWebView2.Navigate("https://www.compositeurdigital.com");

var gVisual = ElementCompositionPreview.GetElementVisual(grid);
var cVisual = gVisual.Compositor.CreateLayerVisual();
ElementCompositionPreview.SetElementChildVisual(grid, cVisual);

c.RootVisualTarget = cVisual;
fMichaleczek commented 3 years ago

do you think it will work on hololens 1 ? Microsoft let me with the old edge and I think they don't care. 😞

champnic commented 3 years ago

Hey @pfresnay - thanks for giving WebView2 a try with UWP!

Native UWP XAML Control ?

We are currently working on a WinUI2 control and hope to have a preview of it out in the next month or two! It should save you having to manually use the CompositionController and dealing with all of the input complexity.

Can we submit an app to the MS Store using current package ?

Yes, you should be able to submit WebView2 apps to the store.

Is it intended to works only on desktop Win10 flavor ?

Yes, this is a current limitation of WebView2. Once we have UWP support we are looking at Hololens and Xbox support. @fMichaleczek I'm not sure if that will include Hololens 1 support or not yet.

Surface Hub Win10 2020 Teams Edition support ?

I'm not sure - I'll have to get back to you on this one.

Official doc ?

We are currently working on UWP/WinUI2 documentation to be released with our preview.

fMichaleczek commented 3 years ago

@champnic Ok. I will trash the two hololens I have, I will add my two Lumia and maybe my 3 computers without TPM2.0. I dont know what Microsoft's game is playing but... it's planned obsolescence.

Thanks for your clear response.

pfresnay commented 3 years ago

@champnic thanks for feedback ! Let me know for Surface Hub :-)

pfresnay commented 3 years ago

@champnic deploy to Surface Hub 2S works but app hangs on startup :-/ App Exception code in Event Viewer: 0xc00027b Edge 92.0.902.55 Win10 Team Edition 19100.10.31 SurfaceService.exe.4648 (5).zip

champnic commented 3 years ago

@pfresnay If you try a regular WinUI3 app without WebView2 is it launching correctly on Surface Hub? My understanding is that Surface Hub is a desktop SKU that only allows UWP, which WinUI3 doesn't have support for yet.

pfresnay commented 3 years ago

@champnic yes Surface Hub only allows UWP, that's why we can't use WinUI3 and need UWP WebView2 support :-)

pfresnay commented 3 years ago

@champnic Hi, do you have info regarding Webview2 support on Surface Hub (UWP without WinUI3)? Any (pre)release date for UWP Webview2, especially new Control? Best

champnic commented 3 years ago

Hey @pfresnay - we're working on a WinUI 2 UWP WebView2 control with a preview coming out soon (within a month)!