Skip to content

Commit c05049e

Browse files
authored
Merge pull request #255 from MicrosoftEdge/smoketest/1.0.2839-testing
Update projects to use latest WebView2 SDK 1.0.2839-prerelease
2 parents d1cf80d + 15ed1dd commit c05049e

File tree

8 files changed

+412
-323
lines changed

8 files changed

+412
-323
lines changed

SampleApps/WebView2APISample/AppWindow.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1429,11 +1429,11 @@ HRESULT AppWindow::OnCreateEnvironmentCompleted(
14291429
m_webViewEnvironment = environment;
14301430

14311431
if (m_webviewOption.entry == WebViewCreateEntry::EVER_FROM_CREATE_WITH_OPTION_MENU ||
1432-
m_creationModeId == IDM_CREATION_MODE_HOST_INPUT_PROCESSING
1433-
)
1432+
m_creationModeId == IDM_CREATION_MODE_HOST_INPUT_PROCESSING)
14341433
{
14351434
return CreateControllerWithOptions();
14361435
}
1436+
14371437
auto webViewEnvironment3 = m_webViewEnvironment.try_query<ICoreWebView2Environment3>();
14381438

14391439
if (webViewEnvironment3 && (m_dcompDevice || m_wincompCompositor))
@@ -1522,6 +1522,7 @@ HRESULT AppWindow::CreateControllerWithOptions()
15221522
}
15231523
}
15241524
//! [AllowHostInputProcessing]
1525+
15251526
if (m_dcompDevice || m_wincompCompositor)
15261527
{
15271528
//! [OnCreateCoreWebView2ControllerCompleted]

SampleApps/WebView2APISample/WebView2APISample.vcxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -480,13 +480,13 @@
480480
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
481481
<ImportGroup Label="ExtensionTargets">
482482
<Import Project="..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
483-
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.2783-prerelease\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.2783-prerelease\build\native\Microsoft.Web.WebView2.targets')" />
483+
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.2839-prerelease\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.2839-prerelease\build\native\Microsoft.Web.WebView2.targets')" />
484484
</ImportGroup>
485485
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
486486
<PropertyGroup>
487487
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
488488
</PropertyGroup>
489489
<Error Condition="!Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
490-
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.2783-prerelease\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.2783-prerelease\build\native\Microsoft.Web.WebView2.targets'))" />
490+
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.2839-prerelease\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.2839-prerelease\build\native\Microsoft.Web.WebView2.targets'))" />
491491
</Target>
492492
</Project>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.Web.WebView2" version="1.0.2783-prerelease" targetFramework="native" />
3+
<package id="Microsoft.Web.WebView2" version="1.0.2839-prerelease" targetFramework="native" />
44
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.220201.1" targetFramework="native" />
55
</packages>

SampleApps/WebView2WindowsFormsBrowser/WebView2WindowsFormsBrowser.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<PlatformTarget>AnyCPU</PlatformTarget>
2626
</PropertyGroup>
2727
<ItemGroup>
28-
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2783-prerelease" />
28+
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2839-prerelease" />
2929
</ItemGroup>
3030
<ItemGroup>
3131
<Folder Include="assets\" />

SampleApps/WebView2WpfBrowser/App.xaml

-12
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,5 @@ found in the LICENSE file.
1212
xmlns:local="clr-namespace:WebView2WpfBrowser"
1313
StartupUri="MainWindow.xaml">
1414
<Application.Resources>
15-
<!--
16-
These CreationProperties use the Evergreen Edge executable that's installed on the machine.
17-
-->
18-
<wv2:CoreWebView2CreationProperties x:Key="EvergreenWebView2CreationProperties" />
19-
<!--
20-
If you want to use fixed version:
21-
1) Navigate to https://developer.microsoft.com/en-us/microsoft-edge/webview2/
22-
2) Choose "Fixed Version", select appropriate version and architecture and click download
23-
3) Unzip the CAB file to a folder
24-
4) Point that folder by `BrowserExecutableFolder` property
25-
-->
26-
<wv2:CoreWebView2CreationProperties x:Key="BYOWebView2CreationProperties" BrowserExecutableFolder="Replace this with BYO folder" />
2715
</Application.Resources>
2816
</Application>

SampleApps/WebView2WpfBrowser/MainWindow.xaml

+22-13
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ found in the LICENSE file.
1616
Width="800"
1717
>
1818
<Window.Resources>
19+
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
1920
</Window.Resources>
2021
<Window.CommandBindings>
2122
<CommandBinding Command="ApplicationCommands.New" Executed="NewCmdExecuted"/>
@@ -60,6 +61,7 @@ found in the LICENSE file.
6061
<CommandBinding Command="{x:Static local:MainWindow.ClearServerCertificateErrorActionsCommand}" Executed="ClearServerCertificateErrorActionsCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
6162
<CommandBinding Command="{x:Static local:MainWindow.SetDefaultDownloadPathCommand}" Executed="SetDefaultDownloadPathCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
6263
<CommandBinding Command="{x:Static local:MainWindow.CreateDownloadsButtonCommand}" Executed="CreateDownloadsButtonCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
64+
<CommandBinding Command="{x:Static local:MainWindow.ShowExtensionsWindowCommand}" Executed="ShowExtensionsWindowCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
6365
<CommandBinding Command="{x:Static local:MainWindow.ToggleMuteStateCommand}" Executed="ToggleMuteStateCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
6466
<CommandBinding Command="{x:Static local:MainWindow.PrintToPdfCommand}" Executed="PrintToPdfCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
6567
<CommandBinding Command="{x:Static local:MainWindow.PinchZoomCommand}" Executed="PinchZoomCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
@@ -94,7 +96,8 @@ found in the LICENSE file.
9496
<CommandBinding Command="{x:Static local:MainWindow.BrowserAcceleratorKeyEnabledCommand}" Executed="BrowserAcceleratorKeyEnabledCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
9597

9698
<CommandBinding Command="{x:Static local:MainWindow.CloseWebViewCommand}" Executed="CloseWebViewCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
97-
<CommandBinding Command="{x:Static local:MainWindow.NewWebViewCommand}" Executed="NewWebViewCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
99+
<CommandBinding Command="{x:Static local:MainWindow.NewWebViewCommand}" Executed="NewWebViewCommandExecuted"/>
100+
<CommandBinding Command="{x:Static local:MainWindow.NewWebViewCompositionControlCommand}" Executed="NewWebViewCompositionControlCommandExecuted" CanExecute="EpxerimentalCmdsCanExecute"/>
98101

99102
<CommandBinding Command="{x:Static local:MainWindow.PermissionManagementCommand}" Executed="PermissionManagementExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
100103
<CommandBinding Command="{x:Static local:MainWindow.NonClientRegionSupportCommand}" Executed="NonClientRegionSupportCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
@@ -136,8 +139,9 @@ found in the LICENSE file.
136139
<!--TODO-->
137140
</MenuItem>
138141
<MenuItem Header="_Window">
139-
<MenuItem Header="_Close WebView" Command="ApplicationCommands.Close"/>
140-
<MenuItem Header="_New WebView" Command="{x:Static local:MainWindow.NewWebViewCommand}"/>
142+
<MenuItem Header="_Close WebView2" Command="{x:Static local:MainWindow.CloseWebViewCommand}"/>
143+
<MenuItem Header="_New WebView2" Command="{x:Static local:MainWindow.NewWebViewCommand}"/>
144+
<MenuItem Header="_New WebView2CompositionControl" Command="{x:Static local:MainWindow.NewWebViewCompositionControlCommand}"/>
141145
<MenuItem Header="_New Window" Command="ApplicationCommands.New"/>
142146
<MenuItem Header="_New Window With Options" Command="{x:Static local:MainWindow.NewWindowWithOptionsCommand}"/>
143147
<MenuItem Header="_Create New Thread" Command="{x:Static local:MainWindow.CreateNewThreadCommand}"/>
@@ -176,7 +180,7 @@ found in the LICENSE file.
176180
<MenuItem Header="Toggle Non-Client Region Support" Command="{x:Static local:MainWindow.NonClientRegionSupportCommand}"/>
177181
</MenuItem>
178182
<MenuItem Header="_View">
179-
<MenuItem Header="Toggle _Visibility" Name="webViewVisible" IsCheckable="True" IsChecked="True"/>
183+
<MenuItem Header="Toggle _Visibility" Name="webViewVisible" IsCheckable="True" IsChecked="True" Checked="OnWebViewVisibleChecked" Unchecked="OnWebViewVisibleUnchecked"/>
180184
<MenuItem Header="Suspend" Command="{x:Static local:MainWindow.SuspendCommand}"/>
181185
<MenuItem Header="Resume" Command="{x:Static local:MainWindow.ResumeCommand}"/>
182186
<MenuItem Header="_Increase Zoom" Command="NavigationCommands.IncreaseZoom"/>
@@ -188,6 +192,7 @@ found in the LICENSE file.
188192
<MenuItem Header="Transparent" Command="{x:Static local:MainWindow.BackgroundColorCommand}" CommandParameter="Transparent"/>
189193
</MenuItem>
190194
<MenuItem Header="_Create Downloads Button" Command="{x:Static local:MainWindow.CreateDownloadsButtonCommand}"/>
195+
<MenuItem Header="Show Extensions Manager" Command="{x:Static local:MainWindow.ShowExtensionsWindowCommand}" />
191196
</MenuItem>
192197
<MenuItem Header="S_cenario">
193198
<MenuItem Header="Au_thentication" Command="{x:Static local:MainWindow.AuthenticationCommand}"/>
@@ -259,7 +264,7 @@ found in the LICENSE file.
259264
<Button DockPanel.Dock="Left" Command="NavigationCommands.BrowseStop">Cancel</Button>
260265
<Button DockPanel.Dock="Right" Command="NavigationCommands.GoToPage" CommandParameter="{Binding ElementName=url,Path=Text}">Go</Button>
261266
<!-- We want the address bar to update based on the WebView's Source, but we don't want the WebView to navigate just from the user typing into the address bar. Therefore we use the OneWay binding mode. -->
262-
<TextBox x:Name="url" Text="{Binding ElementName=webView,Path=Source,Mode=OneWay}">
267+
<TextBox x:Name="url" Text="{Binding ElementName=webView2XamlElement,Path=Source,Mode=OneWay}">
263268
<TextBox.InputBindings>
264269
<KeyBinding Key="Return" Command="NavigationCommands.GoToPage" CommandParameter="{Binding ElementName=url,Path=Text}" />
265270
</TextBox.InputBindings>
@@ -270,14 +275,18 @@ found in the LICENSE file.
270275
<ImageBrush ImageSource="/assets/AppStartPageBackground.png" />
271276
</Grid.Background>
272277

273-
<!-- If you want to use a specific version of WebView2 Runtime change EvergreenWebView2CreationProperties
274-
to BYOWebView2CreationProperties and follow the steps in MainWindow.xaml
275-
-->
276-
<wv2:WebView2
277-
x:Name="webView"
278-
CreationProperties="{StaticResource EvergreenWebView2CreationProperties}"
279-
Source="https://www.bing.com/"
280-
/>
278+
<wv2:WebView2 x:Name="webView2XamlElement">
279+
<wv2:WebView2.CreationProperties>
280+
<!--
281+
By default, this CreationProperties uses the Evergreen WebView2 Runtime that's installed on the machine.
282+
If you want to use a specific version of WebView2 Runtime, change BrowserExecutableFolder to point to the folder
283+
with the runtime. https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#the-fixed-version-runtime-distribution-mode
284+
-->
285+
<wv2:CoreWebView2CreationProperties
286+
BrowserExecutableFolder=""
287+
AdditionalBrowserArguments="" />
288+
</wv2:WebView2.CreationProperties>
289+
</wv2:WebView2>
281290
<!-- The control event handlers are set in code behind so they can be reused when replacing the control after
282291
a WebView2 Runtime's browser process failure
283292
-->

0 commit comments

Comments
 (0)