Skip to content

Commit e32a3a7

Browse files
authored
add back csharp code
1 parent b43a954 commit e32a3a7

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

specs/SensitivityLabel.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ The core features of this proposal are as follows:
2323

2424
Configure the PageInteractionRestrictionManager allow list to enable Sensitivity label functionality on trusted domains.
2525

26+
27+
2628
```cpp
2729
void ConfigureAllowlist()
2830
{
@@ -64,6 +66,22 @@ void ConfigureAllowlist()
6466
}
6567
}
6668
```
69+
```c#
70+
// Configure allowlist for trusted company URLs
71+
var allowlist = new List<string>
72+
{
73+
"https://intranet.company.com/*",
74+
"https://*.company.com/*", // Wildcard for all company subdomains
75+
"https://trusted-partner.com/*",
76+
"https://secure.vendor.net/*"
77+
};
78+
79+
// Set the allowlist on the profile
80+
webView2Control.CoreWebView2.Profile.PageInteractionRestrictionManagerAllowlist = allowlist;
81+
82+
MessageBox.Show($"Allowlist configured with {allowlist.Count} URLs");
83+
```
84+
6785

6886
## Retrieving current allow list
6987

@@ -89,6 +107,20 @@ void GetCurrentAllowlist()
89107
}
90108
}
91109
```
110+
111+
112+
```c#
113+
// Get current allowlist
114+
var currentAllowlist = webView2Control.CoreWebView2.Profile.PageInteractionRestrictionManagerAllowlist;
115+
116+
Console.WriteLine($"Current allowlist contains {currentAllowlist.Count} entries:");
117+
foreach (var url in currentAllowlist)
118+
{
119+
Console.WriteLine($" • {url}");
120+
}
121+
```
122+
123+
92124
## Register for sensitivity label change
93125

94126
```cpp
@@ -230,6 +262,21 @@ interface ICoreWebView2StagingProfile3 : IUnknown {
230262
}
231263
```
232264

265+
```c#
266+
namespace Microsoft.Web.WebView2.Core
267+
{
268+
public partial class CoreWebView2Profile
269+
{
270+
/// <summary>
271+
/// Gets or sets the PageInteractionRestrictionManager allowlist.
272+
/// </summary>
273+
/// <value>A collection of URL patterns that are exempt from page interaction restrictions.
274+
/// Pass an empty collection to clear the allowlist.</value>
275+
public IReadOnlyList<string> PageInteractionRestrictionManagerAllowlist { get; set; }
276+
}
277+
}
278+
```
279+
233280
## Sensitivity label change event
234281
```
235282
/// Represents the state of sensitivity label detection and processing

0 commit comments

Comments
 (0)