Skip to content

Commit c05679c

Browse files
Apply minor wording suggestions
1 parent 5f39822 commit c05679c

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

specs/FileTypePolicy.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ File Type Policy API
22
===
33

44
# Background
5-
When saving a file with original SaveFilePicker, a security alert might be
6-
prompted, because the browser applies the [file type policies](https://learn.microsoft.com/en-us/deployedge/microsoft-edge-security-downloads-interruptions#file-types-requiring-a-gesture)
7-
to protect end users. However, in a WebView2 build App, when end users try
5+
When saving a file with the standard SaveFilePicker (window.showSaveFilePicker),
6+
the user might receive a security alert, as the second prompt to confirm the unsafe file type.
7+
It's because the browser applies the [file type policies](https://learn.microsoft.com/en-us/deployedge/microsoft-edge-security-downloads-interruptions#file-types-requiring-a-gesture)
8+
to protect end users. However, in an app that is using WebView2, when end users try
89
to save a file with a certain file extension, they usually can trust the
910
host App, domain and file extension. So, we provide the App developers the
1011
File Type Policy API to manage the file type policies dynamically.
@@ -13,17 +14,16 @@ We'd appreciate your feedback.
1314

1415
# Description
1516

16-
We proposed the `CoreWebView2.SaveFileSecurityCheckStarting` event. You can register
17-
this event to get the file path, file extension and URI source information,
18-
when end users try to save a file from your App. Then you can apply your own
19-
rules to allow save the file with, or without a default warning dialog;
17+
We proposed the `CoreWebView2.SaveFileSecurityCheckStarting` event. As a developer, you can register a handler on
18+
this event to get the file path, file extension and URI source information. Then you can apply your own
19+
rules to allow save the file without a default file type policy security warning UI;
2020
to cancel the saving; and even to create your own UI to manage runtime
2121
file type policies.
2222

2323
# Examples
2424
## Win32 C++
2525
This example shows suppressing file type policy, security dialog, and
26-
allow to save the file directly. It also blocks saving the exe file.
26+
allows saving eml files directly. It also blocks saving exe files.
2727
The sample code will register the event with custom rules.
2828
```c++
2929
bool ScenarioFileTypePolicyStaging::AddCustomFileTypePolicies()
@@ -66,7 +66,7 @@ bool ScenarioFileTypePolicyStaging::AddCustomFileTypePolicies()
6666

6767
## .Net/ WinRT
6868
This example shows suppressing file type policy, security dialog, and
69-
allow to save the file directly. It also blocks saving the exe file.
69+
allows saving eml files directly. It also blocks saving exe files.
7070
The sample code will register the event with custom rules.
7171
```c#
7272
void AddCustomFileTypePoliciesExecuted(object target, ExecutedRoutedEventArgs e)
@@ -137,7 +137,7 @@ interface ICoreWebView2StagingSaveFileSecurityCheckStartingEventArgs : IUnknown
137137
/// Gets the `Cancel` property.
138138
[propget] HRESULT Cancel([out, retval] BOOL* value);
139139

140-
/// Set if cancel the upcoming save/download. `TRUE` means the action
140+
/// Set whether to cancel the upcoming save/download. `TRUE` means the action
141141
/// will be cancelled before validations in default policy.
142142
///
143143
/// The default value is `FALSE`.
@@ -152,7 +152,8 @@ interface ICoreWebView2StagingSaveFileSecurityCheckStartingEventArgs : IUnknown
152152
/// "*.tar.gz" is a double extension, where the "gz" will be its
153153
/// final extension.
154154
///
155-
/// File extension usage in the API is case sensitive.
155+
/// The file extension is the extension portion of the FilePath,
156+
/// preserving original case.
156157
[propget] HRESULT FileExtension([out, retval] LPWSTR* value);
157158

158159
/// Get the full path of file to be saved. This includes the

0 commit comments

Comments
 (0)