Skip to content

Commit 7f2c776

Browse files
authored
Revise URL matching examples in SensitivityLabel.md
Updated documentation to refer to detailed URL matching examples.
1 parent 9feb93d commit 7f2c776

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

specs/SensitivityLabel.md

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ void ConfigurePageInteractionAllowlist()
4545

4646
auto profile9 = profile.try_query<ICoreWebView2Profile9>();
4747
if (profile9) {
48+
// URL patterns follow wildcard matching rules.
49+
// For detailed examples, refer to the table at: https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.addwebresourcerequestedfilter
4850
LPCWSTR allowedUrls[] = {
4951
// Allow main domain and all its subdomains
5052
L"https://trusted-domain.com/*",
@@ -66,6 +68,8 @@ void ConfigurePageInteractionAllowlist()
6668
```csharp
6769
var profile = webView2.CoreWebView2.Profile;
6870

71+
// URL patterns follow wildcard matching rules.
72+
// For detailed examples, refer to the table at: https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.addwebresourcerequestedfilter
6973
var allowedUrls = new string[]
7074
{
7175
// Allow main domain and all its subdomains
@@ -219,25 +223,13 @@ void WebView_SensitivityLabelChanged(object sender, CoreWebView2SensitivityLabel
219223
/// The allowlist accepts both exact URL strings and wildcard patterns.
220224
/// For wildcard patterns, `*` matches zero or more characters.
221225
///
222-
/// | URL Filter | Page URL | Access Granted | Notes |
223-
/// | ---- | ---- | ---- | ---- |
224-
/// | `https://example.com` | `https://example.com/page` | No | Exact match required |
225-
/// | `https://example.com` | `https://example.com` | No | The URI is normalized before filter matching so the actual URI used for comparison is https://example.com/ |
226-
/// | `https://example.com/*` | `https://example.com/page` | Yes | Wildcard matches any path |
227-
/// | `*://example.com/*` | `https://example.com/page` | Yes | Wildcard matches any scheme |
228-
/// | `*` | `https://any-site.com` | Yes | Wildcard matches all URLs |
229-
///
230-
/// Setting the allowlist to an empty array will disable access to the
231-
/// PageInteractionRestrictionManager API for all pages.
232-
///
233-
/// Changes take effect immediately for all WebView2 instances using this profile.
234-
/// The allowlist is persisted across sessions.
226+
/// For detailed URL matching examples, refer to the table at [`AddWebResourceRequestedFilter`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.addwebresourcerequestedfilter).
235227
HRESULT SetPageInteractionRestrictionManagerAllowList(
236228
[in] UINT32 allowlistCount,
237229
[in] LPCWSTR* allowlist
238230
);
239-
}
240231
```
232+
241233
### .NET/WinRT
242234
```idl
243235
namespace Microsoft.Web.WebView2.Core
@@ -254,13 +246,7 @@ namespace Microsoft.Web.WebView2.Core
254246
/// The allowlist accepts both exact URL strings and wildcard patterns.
255247
/// For wildcard patterns, `*` matches zero or more characters.
256248
///
257-
/// | URL Filter | Page URL | Access Granted | Notes |
258-
/// | ---- | ---- | ---- | ---- |
259-
/// | `https://example.com` | `https://example.com/page` | No | Exact match required |
260-
/// | `https://example.com` | `https://example.com` | No | The URI is normalized before filter matching so the actual URI used for comparison is https://example.com/ |
261-
/// | `https://example.com/*` | `https://example.com/page` | Yes | Wildcard matches any path |
262-
/// | `*://example.com/*` | `https://example.com/page` | Yes | Wildcard matches any scheme |
263-
/// | `*` | `https://any-site.com` | Yes | Wildcard matches all URLs |
249+
/// For detailed URL matching examples, refer to the table at [`AddWebResourceRequestedFilter`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.addwebresourcerequestedfilter).
264250
void SetPageInteractionRestrictionManagerAllowList(Windows.Foundation.Collections.IIterable<String> allowList);
265251
}
266252
}

0 commit comments

Comments
 (0)