|
2 | 2 |
|
3 | 3 | [Edge SmartScreen](https://docs.microsoft.com/en-us/deployedge/microsoft-edge-security-smartscreen) helps you identify reported phishing and malware websites, and also helps you make informed decisions about downloads. |
4 | 4 |
|
5 | | -In the current version of the Edge browser, users can switch the state of SmartScreen at any time. However, the webview2 application can only be set at initialization. In order to add more flexibility to the webview2 application. This API is added to keep the SmartScreen setting consistent with the browser. Development Users can control the status of SmartScreen at any time. |
| 5 | +Currently, users can use `options->put_AdditionalBrowserArguments(L"--disable-features=msSmartScreenProtection")` to control SmartScreen in the WebView2 application. It is essentially a startup parameter of the browser process. It must be determined when the WebView2Environment is created. And Cannot be modified at runtime. |
| 6 | + |
| 7 | +To support more flexibility. We introduce a new API. |
6 | 8 |
|
7 | 9 | In this document we describe the new setting. We'd appreciate your feedback. |
8 | 10 |
|
9 | 11 |
|
10 | 12 | # Description |
11 | | -The configuration of SmartScreen is stored in the user data folder. So its configuration is bound to the environment. Users can use ICoreWebView2Environment to control it. |
| 13 | +Users can use ICoreWebView2Environment to control it.When it is changed, all WebView2 applications using the same path of the user data folder will be changed. |
12 | 14 |
|
13 | | -The default value for `IsSmartScreenEnabled` is `true`. |
| 15 | +The default value for `IsSmartScreenEnabled` is `true`,and defaults are always reset when the app is restarted |
14 | 16 | When this setting is set to `false`, It will turn off SmartScreen protection when visiting web pages. |
15 | 17 |
|
16 | | -Disabling/Enabling `IsSmartScreenEnabled` will take effect immediately. |
| 18 | +Changes to `IsSmartScreenEnabled` does not take effect until the next navigation. |
17 | 19 |
|
18 | 20 |
|
19 | 21 | # Examples |
@@ -60,14 +62,13 @@ interface ICoreWebView2Environment11 : ICoreWebView2Environment10 { |
60 | 62 | /// All WebViews using the same user data folder share the same SmartScreen setting. |
61 | 63 | /// When it is changed, the change will be applied to all WebViews using the |
62 | 64 | /// same user data folder. |
| 65 | + /// Because SmartScreen helps protect your users from phishing and malware, |
| 66 | + /// we do not recommend turning it off unless you know your app is only loading |
| 67 | + /// web content you control and trust. |
63 | 68 | /// \snippet SettingsComponent.cpp ToggleSmartScreenEnabled. |
64 | | - /// Get the IsSmartScreenEnabled property needs to be used after |
65 | | - /// CreateCoreWebView2Controller is called.Otherwise return E_ACCESSDENIED. |
66 | 69 | [propget] HRESULT IsSmartScreenEnabled([out, retval] BOOL* value); |
67 | 70 |
|
68 | 71 | /// Set the IsSmartScreenEnabled property. |
69 | | - /// This configuration will be saved. |
70 | | - /// The configuration from the last exit will be used on the next open |
71 | 72 | [propput] HRESULT IsSmartScreenEnabled([in] BOOL value); |
72 | 73 |
|
73 | 74 | } |
|
0 commit comments