You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Additional considerations for WebView2 on HoloLens 2
27
-
28
-
29
-
<!-- ------------------------------ -->
30
-
#### Limitations and known issues
26
+
## Limitations and known issues
31
27
32
28
When developing a HoloLens 2 Unity app with WebView2, be aware of some limitations and known issues:
33
29
@@ -42,8 +38,8 @@ When developing a HoloLens 2 Unity app with WebView2, be aware of some limitatio
42
38
***Performance**: Complex websites with heavy use of JavaScript or advanced rendering may impact system performance or the host application's framerate. For general performance-related limitations and recommendations, see [Understanding performance for mixed reality](/windows/mixed-reality/develop/advanced-concepts/understanding-performance-for-mixed-reality) in the mixed reality documentation. Also see [Performance optimization](#performance-optimization), below.
Some navigation methods are demonstrated in [Step 7 - Extending WebView2 functionality](../get-started/hololens2.md#step-7---extending-webview2-functionality) in _Get started with WebView2 in HoloLens 2 Unity apps (Preview)_. The present section expands on that demonstration.
67
63
@@ -70,8 +66,8 @@ See also:
70
66
*[API Reference for Mixed Reality WebView plugin](/windows/mixed-reality/develop/advanced-concepts/webview2-unity-plugin) - for HoloLens 2 in the WebView2 Unity plugin.<!-- toc title: WebView2 Unity Plugin API -->
71
67
72
68
73
-
<!-- ---------- -->
74
-
######IWebView interface
69
+
<!-- -------------------------------->
70
+
#### IWebView interface
75
71
76
72
<!-- [IWebView::Load method]()-->
77
73
@@ -93,8 +89,8 @@ public interface IWebView
93
89
```
94
90
95
91
96
-
<!-- ---------- -->
97
-
######IWithBrowserHistory interface
92
+
<!-- -------------------------------->
93
+
#### IWithBrowserHistory interface
98
94
99
95
The `IWithBrowserHistory` interface exposes a few methods and events related to page navigation. This mainly allows developers to navigate forward and backward, as you would expect with a typical web-browsing experience:
100
96
@@ -114,8 +110,8 @@ public interface IWithBrowserHistory : IWebView
114
110
```
115
111
116
112
117
-
<!-- ---------- -->
118
-
######SetVirtualHostNameToFolderMapping and SetVirtualHostMapping
113
+
<!-- -------------------------------->
114
+
#### SetVirtualHostNameToFolderMapping and SetVirtualHostMapping
119
115
120
116
The [CoreWebView2.SetVirtualHostNameToFolderMapping Method](/dotnet/api/microsoft.web.webview2.core.corewebview2.setvirtualhostnametofoldermapping) enables mapping between a virtual host name and a folder path, making it accessible to websites using that host name. This method maps a local domain name to a local folder, so that the WebView2 control loads content from the specified local folder when attempting to access a resource for that domain.
121
117
@@ -153,8 +149,8 @@ public class WebViewExample : MonoBehaviour
Print to PDF requires that the app have access to a writeable location in UWP, such as a local folder. For a full list of UWP-accessible paths, see [File access permissions](/windows/uwp/files/file-access-permissions).
33
29
34
30
See also:
35
31
*[Printing](../concepts/overview-features-apis.md#printing) in _Overview of WebView2 APIs_.
WebView2 sends URLs that are navigated to in your application to the [SmartScreen](/windows/security/threat-protection/microsoft-defender-smartscreen/microsoft-defender-smartscreen-overview) service, to ensure that your customers stay secure. If you want to disable this navigation, you can do so via an environment variable:
51
47
@@ -54,37 +50,43 @@ WebView2 sends URLs that are navigated to in your application to the [SmartScree
54
50
This environment variable must be set prior to `CoreWebView2` creation, which occurs when the [WebView2.Source property](/windows/winui/api/microsoft.ui.xaml.controls.webview2.source) is initially set or the [WebView2.EnsureCoreWebView2Async method](/windows/winui/api/microsoft.ui.xaml.controls.webview2.ensurecorewebview2async) is initially called.
There are a couple of known limitations for current downloads behavior for WebView2 in UWP.
61
57
62
-
###### Save As
58
+
59
+
<!-- ------------------------------ -->
60
+
#### Save As
63
61
64
62
Saving files via **Save As** is working and is enabled for WebView2 for UWP apps. The files will be saved in the folder that the user selects.
65
63
66
-
###### Which folder the files are downloaded to
64
+
65
+
<!-- ------------------------------ -->
66
+
#### Which folder the files are downloaded to
67
67
68
68
If the host doesn't change the `ResultFilePath` of the downloaded file, the downloaded files will be downloaded to a subfolder with the app package's name in the `Downloads` folder.
69
69
70
70
If the host changes the `ResultFilePath` of the downloaded file, the file will only be downloaded if the app has access to that file path by default. If you want to use a file location that the app doesn't have access to by default, you must set the corresponding capability. See [App capability declarations](/windows/uwp/packaging/app-capability-declarations) in the UWP documentation.
71
71
72
-
###### Downloads Hub
72
+
73
+
<!-- ------------------------------ -->
74
+
#### Downloads Hub
73
75
74
76
Opening files and folders from the Downloads Hub is disabled. Clicking on the file or folder icon won't open the respective file/folder.
75
77
76
78
See also:
77
79
*[Downloads](../concepts/overview-features-apis.md#downloads) in _Overview of WebView2 APIs_.
On WinUI 2, the `DefaultBackgroundColor` property is not exposed directly. You can set the default background color by setting an environment variable, as follows:
On WinUI 2 (UWP), CSS cursors have the following limitations.
117
119
118
120
119
-
###### Image URLs
121
+
<!-- ------------------------------ -->
122
+
#### Image URLs
120
123
121
124
The CSS cursor cannot be an image URL, such as `cursor: url(https://contoso.com/cursor.png), pointer;`. See [CSS - cursor loaded from URL doesn't work](https://github.com/MicrosoftEdge/WebView2Feedback/issues/1925).
122
125
123
126
124
-
###### Predefined CSS cursors
127
+
<!-- ------------------------------ -->
128
+
#### Predefined CSS cursors
125
129
126
130
On WinUI 2 (UWP), some of the predefined CSS cursors are not supported. You can use CSS cursors to change the cursor to some of the predefined cursors, such as `cursor: wait;` or `cursor: crosshair;`, but not to others, such as `cursor: progress` or `cursor: none`.
127
131
@@ -175,14 +179,14 @@ See also:
175
179
<!-- known limitation: destination page doesn't scroll to anchor -->
On WinUI 2, Microsoft Edge DevTools cannot be launched inside a store-signed WebView2 WinUI 2 (UWP) app. However, you can work around this by using remote debugging. See [Remote debugging WebView2 WinUI 2 (UWP) apps](../how-to/remote-debugging.md).
WebView2 sends URLs that are navigated to in your application to the [SmartScreen](/windows/security/threat-protection/microsoft-defender-smartscreen/microsoft-defender-smartscreen-overview) service, to ensure that your customers stay secure. If you want to disable this navigation, use a custom `CoreWebView2Environment`, as follows:
## Disabling SmartScreen by using an environment variable
61
59
62
60
We no longer recommend using an environment variable. Use the above API code-based approach instead.
63
61
@@ -66,8 +64,8 @@ We no longer recommend using an environment variable. Use the above API code-ba
66
64
This environment variable must be set prior to `CoreWebView2` creation, which occurs when the [WebView2.Source property](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.webview2.source#microsoft-ui-xaml-controls-webview2-source) is initially set or the [WebView2.EnsureCoreWebView2Async method](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.webview2.ensurecorewebview2async#microsoft-ui-xaml-controls-webview2-ensurecorewebview2async) is initially called.
WinUI 3 doesn't support transparent backgrounds. See [Transparent background support for WebView2? · Issue #2992](https://github.com/microsoft/microsoft-ui-xaml/issues/2992).
0 commit comments