diff --git a/SampleApps/WebView2APISample/WebView2APISample.vcxproj b/SampleApps/WebView2APISample/WebView2APISample.vcxproj index 882eb5f4..87af0f7a 100644 --- a/SampleApps/WebView2APISample/WebView2APISample.vcxproj +++ b/SampleApps/WebView2APISample/WebView2APISample.vcxproj @@ -480,13 +480,13 @@ - + 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}. - + diff --git a/SampleApps/WebView2APISample/documentation/Testing-Instructions.md b/SampleApps/WebView2APISample/documentation/Testing-Instructions.md index 6b1d21b0..0f3b4160 100644 --- a/SampleApps/WebView2APISample/documentation/Testing-Instructions.md +++ b/SampleApps/WebView2APISample/documentation/Testing-Instructions.md @@ -1448,12 +1448,10 @@ this the `appRegion` changes would not take place until some document element wa 1. Right click 'Microsoft Edge WebView2' element and select `restore` 1. Expected: Sample app will restore. -#### Interactive Dragging +#### Interactive Dragging Enabled By Default -Test that interactive dragging works on Webview2. +Test that interactive dragging is enabled by default on Webview2. -1. Run the application with the following flag - --edge-webview-interactive-dragging. 1. Click Scenario > Non-Client Region Support. 1. Look under the Heading "Interactive Elements". 1. Hover the mouse on the textarea and button. @@ -1468,6 +1466,24 @@ Test that interactive dragging works on Webview2. 1. Click button. 1. Expected: The click counter should increment. +#### Interactive Dragging Opt-out + +Test that the interactive dragging opt-out switch works on Webview2. + +1. run the app with the flag + --edge-webview-disable-interactive-dragging +1. Click Scenario > Non-Client Region Support. +1. Look under the Heading "Interactive Elements". +1. Hover the mouse on the textarea and button. +1. Expected: Cursor should be arrow, the element border should + stay the same. +1. Drag on text area and button. +1. Expected: The entire app should drag. +1. Click into text area. +1. Expected: Cursor remains the same. +1. Click button. +1. Expected: The click counter should not increment. + #### Drag and Drop Test that Drag and Drop is supported in WebView2 using both hosting modes. diff --git a/SampleApps/WebView2APISample/packages.config b/SampleApps/WebView2APISample/packages.config index 715bfe9c..7da83727 100644 --- a/SampleApps/WebView2APISample/packages.config +++ b/SampleApps/WebView2APISample/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/SampleApps/WebView2WindowsFormsBrowser/BrowserForm.cs b/SampleApps/WebView2WindowsFormsBrowser/BrowserForm.cs index 7923214b..dcc87553 100644 --- a/SampleApps/WebView2WindowsFormsBrowser/BrowserForm.cs +++ b/SampleApps/WebView2WindowsFormsBrowser/BrowserForm.cs @@ -13,6 +13,7 @@ using Microsoft.Web.WebView2.Core; using Microsoft.Web.WebView2.WinForms; using System.Linq; +using System.ComponentModel; namespace WebView2WindowsFormsBrowser { @@ -1448,25 +1449,29 @@ private string GetAppPath() private string GetRuntimePath(CoreWebView2 webView2) { - int processId = (int)webView2.BrowserProcessId; - try - { - Process process = System.Diagnostics.Process.GetProcessById(processId); - var fileName = process.MainModule.FileName; - return System.IO.Path.GetDirectoryName(fileName); - } - catch (ArgumentException e) - { - Trace.WriteLine(e.Message); - } - catch (SystemException e) - { - Trace.WriteLine(e.Message); - } - return ""; + int processId = (int)webView2.BrowserProcessId; + try + { + Process process = System.Diagnostics.Process.GetProcessById(processId); + var fileName = process.MainModule.FileName; + return System.IO.Path.GetDirectoryName(fileName); + } + catch (ArgumentException e) + { + return e.Message; + } + catch (InvalidOperationException e) + { + return e.Message; + } + // Occurred when a 32-bit process wants to access the modules of a 64-bit process. + catch (Win32Exception e) + { + return e.Message; + } } - private string GetStartPageUri(CoreWebView2 webView2) + private string GetStartPageUri(CoreWebView2 webView2) { string uri = "https://appassets.example/AppStartPage.html"; if (webView2 == null) diff --git a/SampleApps/WebView2WindowsFormsBrowser/WebView2WindowsFormsBrowser.csproj b/SampleApps/WebView2WindowsFormsBrowser/WebView2WindowsFormsBrowser.csproj index 380678ef..62f1d994 100644 --- a/SampleApps/WebView2WindowsFormsBrowser/WebView2WindowsFormsBrowser.csproj +++ b/SampleApps/WebView2WindowsFormsBrowser/WebView2WindowsFormsBrowser.csproj @@ -25,7 +25,7 @@ AnyCPU - + diff --git a/SampleApps/WebView2WpfBrowser/MainWindow.xaml b/SampleApps/WebView2WpfBrowser/MainWindow.xaml index 33db0071..763b498b 100644 --- a/SampleApps/WebView2WpfBrowser/MainWindow.xaml +++ b/SampleApps/WebView2WpfBrowser/MainWindow.xaml @@ -107,7 +107,6 @@ found in the LICENSE file. - diff --git a/SampleApps/WebView2WpfBrowser/MainWindow.xaml.cs b/SampleApps/WebView2WpfBrowser/MainWindow.xaml.cs index 96d39d4f..30b02d1f 100644 --- a/SampleApps/WebView2WpfBrowser/MainWindow.xaml.cs +++ b/SampleApps/WebView2WpfBrowser/MainWindow.xaml.cs @@ -6,6 +6,7 @@ using System.Collections; using System.Collections.Generic; using System.ComponentModel; +using System.Data.Common; using System.Diagnostics; using System.IO; using System.Linq; @@ -127,6 +128,13 @@ public partial class MainWindow : Window public static RoutedCommand ToggleScreenCaptureEnableCommand = new RoutedCommand(); public static RoutedCommand FileTypePolicyCommand = new RoutedCommand(); + public static RoutedCommand ServiceWorkerRegisteredCommand = new RoutedCommand(); + public static RoutedCommand GetServiceWorkerRegistrationsCommand = new RoutedCommand(); + public static RoutedCommand GetServiceWorkerRegisteredForScopeCommand = new RoutedCommand(); + public static RoutedCommand DedicatedWorkerCreatedCommand = new RoutedCommand(); + public static RoutedCommand SharedWorkerManagerCommand = new RoutedCommand(); + public static RoutedCommand GetSharedWorkersCommand = new RoutedCommand(); + #endregion commands bool _isNavigating = false; @@ -3718,5 +3726,27 @@ void WebView_FileTypePolicy_DOMContentLoaded(object sender, CoreWebView2DOMConte } #endif + void DedicatedWorkerCreatedExecuted(object target, ExecutedRoutedEventArgs e) + { + } + void ServiceWorkerRegisteredExecuted(object target, ExecutedRoutedEventArgs e) + { + } + private async void GetServiceWorkerRegistrationsExecuted(object target, ExecutedRoutedEventArgs e) + { + await Task.Delay(0); + } + + async void GetServiceWorkerRegisteredForScopeExecuted(object target, ExecutedRoutedEventArgs e) + { + await Task.Delay(0); + } + void SharedWorkerManagerExecuted(object target, ExecutedRoutedEventArgs e) + { + } + private async void GetSharedWorkersExecuted(object target, ExecutedRoutedEventArgs e) + { + await Task.Delay(0); + } + } } -} diff --git a/SampleApps/WebView2WpfBrowser/WebView2WpfBrowser.csproj b/SampleApps/WebView2WpfBrowser/WebView2WpfBrowser.csproj index 3631fc58..afbbfd5b 100644 --- a/SampleApps/WebView2WpfBrowser/WebView2WpfBrowser.csproj +++ b/SampleApps/WebView2WpfBrowser/WebView2WpfBrowser.csproj @@ -61,7 +61,7 @@ - +