Skip to content

Commit f767dde

Browse files
authored
Update SensitivityLabel.md for URL terminology
1 parent 839250a commit f767dde

1 file changed

Lines changed: 31 additions & 32 deletions

File tree

specs/SensitivityLabel.md

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<!--
21
Before submitting, delete all "<!-- TEMPLATE" marked comments in this file,
32
and the following quote banner:
43
-->
@@ -58,7 +57,7 @@ Sensitivity label support for Webview2
5857
do not get copied into any official documentation, they're just an aid
5958
to reading this spec. If you find useful information in the background
6059
or appendix consider moving it to documentation.
61-
60+
6261
If you're modifying an existing API, included a link here to the
6362
existing page(s) or spec documentation.
6463
@@ -67,7 +66,7 @@ Sensitivity label support for Webview2
6766
6867
For example, this is a place to provide a brief explanation of some dependent
6968
area, just explanation enough to understand this new API, rather than telling
70-
the reader "go read 100 pages of background information posted at ...".
69+
the reader "go read 100 pages of background information posted at ...".
7170
-->
7271
Web pages may contain content with sensitive information. Such information can be identified using data loss protection methods. The purpose of this API is to provide sensitivity label information, communicated by web pages through the Page Interaction Restriction Manager (see details here), to the host application. This enables the host application to be informed of the presence of sensitive content.
7372

@@ -90,7 +89,7 @@ _(This is conceptual documentation that will go to learn.microsoft.com "how to"
9089
lean towards including text in the API documentation below instead of in this conceptual
9190
section.
9291
-->
93-
We propose introducing a SensitivityLabelChanged event to the CoreWebView2 object, enabling applications to monitor changes in sensitivity labels within hosted content. This functionality is restricted to domains explicitly included in an allow list configured by the application. The allow list can be set at the profile level, thereby enabling the Page Interaction Restriction Manager for content within specified domains. By default, the allow list is empty, preventing hosted content from transmitting sensitivity label information.
92+
We propose introducing a SensitivityLabelChanged event to the CoreWebView2 object, enabling applications to monitor changes in sensitivity labels within hosted content. This functionality is restricted to URLs explicitly included in an allow list configured by the application. The allow list can be set at the profile level, thereby enabling the Page Interaction Restriction Manager for content within specified URLs. By default, the allow list is empty, preventing hosted content from transmitting sensitivity label information.
9493
The core features of this proposal are as follows:
9594
• Configure the allowlist filter for Page Interaction Restriction Manager at the profile level.
9695
• After setup, the manager is available on allowlisted pages. Content can send sensitivity labels to the platform via the API.
@@ -104,19 +103,19 @@ The core features of this proposal are as follows:
104103
Configure the PageInteractionRestrictionManager allowlist to enable DLP functionality on trusted domains.
105104

106105
```c#
107-
// Configure allowlist for trusted company domains
106+
// Configure allowlist for trusted company URLs
108107
var allowlist = new List<string>
109108
{
110-
"https://intranet.company.com",
111-
"https://*.company.com", // Wildcard for all company subdomains
112-
"https://trusted-partner.com",
113-
"https://secure.vendor.net"
109+
"https://intranet.company.com/*",
110+
"https://*.company.com/*", // Wildcard for all company subdomains
111+
"https://trusted-partner.com/*",
112+
"https://secure.vendor.net/*"
114113
};
115114

116115
// Set the allowlist on the profile
117-
await webView2Control.CoreWebView2.Profile.SetPageInteractionRestrictionManagerAllowlistAsync(allowlist);
116+
webView2Control.CoreWebView2.Profile.SetPageInteractionRestrictionManagerAllowlist(allowlist);
118117

119-
MessageBox.Show($"Allowlist configured with {allowlist.Count} domains");
118+
MessageBox.Show($"Allowlist configured with {allowlist.Count} URLs");
120119
```
121120

122121
```cpp
@@ -128,31 +127,31 @@ void ConfigureAllowlist()
128127

129128
auto stagingProfile3 = profile.try_query<ICoreWebView2StagingProfile3>();
130129
if (stagingProfile3) {
131-
// Create allowlist with trusted domains
130+
// Create allowlist with trusted URLs
132131
std::vector<std::wstring> allowlist = {
133-
L"https://intranet.company.com",
134-
L"https://*.company.com",
135-
L"https://trusted-partner.com"
132+
L"https://intranet.company.com/*",
133+
L"https://*.company.com/*",
134+
L"https://trusted-partner.com/*"
136135
};
137-
136+
138137
// Convert to LPCWSTR array for COM interface
139138
std::vector<LPCWSTR> items;
140139
for (const auto& url : allowlist) {
141140
items.push_back(url.c_str());
142141
}
143-
142+
144143
// Get environment to create string collection
145144
wil::com_ptr<ICoreWebView2Environment> environment;
146145
CHECK_FAILURE(m_webView->get_Environment(&environment));
147-
146+
148147
auto stagingEnvironment15 = environment.try_query<ICoreWebView2StagingEnvironment15>();
149148
if (stagingEnvironment15) {
150149
wil::com_ptr<ICoreWebView2StringCollection> stringCollection;
151150
CHECK_FAILURE(stagingEnvironment15->CreateStringCollection(
152-
static_cast<UINT32>(items.size()),
153-
items.data(),
151+
static_cast<UINT32>(items.size()),
152+
items.data(),
154153
&stringCollection));
155-
154+
156155
// Apply the allowlist
157156
CHECK_FAILURE(stagingProfile3->SetPageInteractionRestrictionManagerAllowlist(
158157
stringCollection.get()));
@@ -165,7 +164,7 @@ void ConfigureAllowlist()
165164

166165
```c#
167166
// Get current allowlist
168-
var currentAllowlist = await webView2Control.CoreWebView2.Profile.GetPageInteractionRestrictionManagerAllowlistAsync();
167+
var currentAllowlist = await webView2Control.CoreWebView2.Profile.GetPageInteractionRestrictionManagerAllowlist();
169168

170169
Console.WriteLine($"Current allowlist contains {currentAllowlist.Count} entries:");
171170
foreach (var url in currentAllowlist)
@@ -185,7 +184,7 @@ void GetCurrentAllowlist()
185184
if (SUCCEEDED(result) && allowlist) {
186185
UINT count = 0;
187186
CHECK_FAILURE(allowlist->get_Count(&count));
188-
187+
189188
wprintf(L"Current allowlist contains %u entries:\n", count);
190189
for (UINT i = 0; i < count; ++i) {
191190
wil::unique_cotaskmem_string item;
@@ -208,7 +207,7 @@ void GetCurrentAllowlist()
208207
include that and consider including it in its own HTML or JS sample code.
209208
210209
As an example of this section, see the Examples section for the Custom Downloads
211-
APIs (https://github.com/MicrosoftEdge/WebView2Feedback/blob/master/specs/CustomDownload.md).
210+
APIs (https://github.com/MicrosoftEdge/WebView2Feedback/blob/master/specs/CustomDownload.md).
212211
213212
The general format is:
214213
@@ -224,7 +223,7 @@ void GetCurrentAllowlist()
224223
show.SomeMembers = AndWhyItMight(be, interesting)
225224
}
226225
```
227-
226+
228227
```cpp
229228
void SampleClass::SampleMethod()
230229
{
@@ -252,7 +251,7 @@ void GetCurrentAllowlist()
252251
show.SomeMembers = AndWhyItMight(be, interesting)
253252
}
254253
```
255-
254+
256255
```cpp
257256
void SampleClass::SampleMethod()
258257
{
@@ -292,7 +291,7 @@ interface ICoreWebView2StagingProfile3 : IUnknown {
292291
/// The allowlist contains URL patterns that are exempt from page interaction restrictions.
293292
HRESULT GetPageInteractionRestrictionManagerAllowlist(
294293
[in] ICoreWebView2StagingGetPageInteractionRestrictionManagerAllowlistCompletedHandler* handler);
295-
294+
296295
/// Set the PageInteractionRestrictionManager allowlist.
297296
/// URL patterns in this allowlist will be exempt from page interaction restrictions
298297
/// imposed by DLP policies. Pass an empty collection to clear the allowlist.
@@ -318,8 +317,8 @@ namespace Microsoft.Web.WebView2.Core
318317
/// Get the current PageInteractionRestrictionManager allowlist.
319318
/// </summary>
320319
/// <returns>A collection of URL patterns that are exempt from page interaction restrictions.</returns>
321-
public async Task<IReadOnlyList<string>> GetPageInteractionRestrictionManagerAllowlistAsync();
322-
320+
public async Task<IReadOnlyList<string>> GetPageInteractionRestrictionManagerAllowlist();
321+
323322
/// <summary>
324323
/// Set the PageInteractionRestrictionManager allowlist.
325324
/// </summary>
@@ -345,11 +344,11 @@ namespace Microsoft.Web.WebView2.Core
345344
use ```c# instead even when writing MIDL3.)
346345
347346
Example:
348-
347+
349348
```
350349
[uuid(B625A89E-368F-43F5-BCBA-39AA6234CCF8), object, pointer_default(unique)]
351350
interface ICoreWebView2Settings4 : ICoreWebView2Settings3 {
352-
/// The IsPinchZoomEnabled property enables or disables the ability of
351+
/// The IsPinchZoomEnabled property enables or disables the ability of
353352
/// the end user to use a pinching motion on touch input enabled devices
354353
/// to scale the web content in the WebView2. It defaults to TRUE.
355354
/// When set to FALSE, the end user cannot pinch zoom.
@@ -412,7 +411,7 @@ interface HostObjectsOptions {
412411
<!-- TEMPLATE
413412
Anything else that you want to write down about implementation notes and for posterity,
414413
but that isn't necessary to understand the purpose and usage of the API.
415-
414+
416415
This or the Background section are a good place to describe alternative designs
417416
and why they were rejected, any relevant implementation details, or links to other
418417
resources.

0 commit comments

Comments
 (0)