From 91312ebf1e8e1768d204f26f00d07cd19cba12a8 Mon Sep 17 00:00:00 2001 From: Kuba Sunderland-Ober Date: Wed, 13 May 2026 13:24:42 +0200 Subject: [PATCH 1/3] Update the WIP instructions before documenting more packages. --- WIP.md | 157 ++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 110 insertions(+), 47 deletions(-) diff --git a/WIP.md b/WIP.md index 36daa543..0583887f 100644 --- a/WIP.md +++ b/WIP.md @@ -4,13 +4,14 @@ Jekyll site (`just-the-docs` theme) deploying to `docs.twinbasic.com`. Source un ## Current Task -Fill out reference documentation by adapting Microsoft VBA-Docs (CC-BY-4.0) for twinBASIC, and document the VB-package control classes from their `.twin` source. Always work from a primary source — never paraphrase from memory. +Fill out reference documentation by adapting Microsoft VBA-Docs (CC-BY-4.0) for twinBASIC, and document the twinBASIC-specific packages (`VB`, `WebView2Package`, …) from their `.twin` source. Always work from a primary source — never paraphrase from memory. Status: - **VBA package** — done. - **VBRUN package** — done. -- **VB package** (standard controls) — in progress; see [Backlog discovery](#backlog-discovery). +- **VB package** — done. +- **WebView2Package** — in progress. ## Where things live @@ -20,6 +21,7 @@ Status: - `docs/Reference/VB/.md` — single-file class page (e.g. [`CheckBox.md`](docs/Reference/VB/CheckBox.md)). - `docs/Reference/VB//index.md` — folder-style class page when sub-pages may follow (e.g. [`CheckMark/index.md`](docs/Reference/VB/CheckMark/index.md)). - `docs/Reference/VB/todo.md` — backlog tracker for the VB package; see [Backlog discovery](#backlog-discovery). +- `docs/Reference/WebView2Package/` — WebView2 package: the **WebView2** control class plus its small wrapper classes (request / response / headers / environment options) and the `wv2…` enumerations. - `docs/Reference/Statements.md` — alphabetical index of language statements. - `docs/Reference/Procedures and Functions.md` — alphabetical index of procedures/functions. - `docs/_includes/footer_custom.html` — overrides the theme's footer slot; renders the copyright line and, when `vba_attribution: true` is set in a page's frontmatter, an additional CC-BY-4.0 attribution line beneath it. @@ -36,19 +38,67 @@ Common kinds: `-statement`, `-function`, `-property`, `-method`, `-object`, `-op Used for: Core statements/keywords, the VBA package, and the VBRUN package. -## VB controls source (read-only) +## TwinBASIC Package source (read-only) -The standard control classes have no VBA-Docs equivalent — they're documented from the AGST-asm `.twin` source: +All of twinbasic's package sources are at: ``` -..\AGST-asm\Source\Packages\VB\Sources\CONTROLS\STANDARD\.twin -..\AGST-asm\Source\Packages\VB\Sources\CONTROLS\OTHER\.twin -..\AGST-asm\Source\Packages\VB\Sources\BASE\Base*.twin +..\tb-export\NewProject\Packages\VB\Sources\CONTROLS\STANDARD\.twin +..\tb-export\NewProject\Packages\VB\Sources\CONTROLS\OTHER\.twin +..\tb-export\NewProject\Packages\VB\Sources\BASE\Base*.twin +..\tb-export\NewProject\Packages\VBA\Sources\ +..\tb-export\NewProject\Packages\VBRUN\Sources\ +..\tb-export\NewProject\Packages\WebView2Package\Sources\ +etc. ``` +### VB Controls + The `STANDARD/` folder is the primary backlog. The `BASE/` folder defines the inheritance chain (e.g. `BaseControlWindowlessNoFocus` → `BaseControlRectDockable` → `BaseControlRect` → `BaseControl`); read those alongside the leaf class to know which `Public` members are actually visible. Members marked `Protected` or hidden behind `[Unimplemented]` should be flagged with a `> [!NOTE]` callout. -Used for: the VB package only. These pages are fully original content — **omit** the `vba_attribution: true` frontmatter flag. +These pages are fully original content — **omit** the `vba_attribution: true` frontmatter flag. + +### WebView2Package + +Layout of `..\tb-export\NewProject\Packages\WebView2Package\Sources\`: + +- `Classes/` — the implementation classes. Only a few are part of the user-facing surface; the rest are `Private` plumbing. +- `Abstract/` — raw `ICoreWebView2*` COM interfaces. Every one is declared `Private Interface`; these are pure implementation detail and get **no documentation page**. +- `Support/Enumerations.twin` — the `wv2…` enumerations, all in the `WebViewEnums` module. +- `Support/Types.twin` — the `WebViewTypes` module; currently only `COREWEBVIEW2_PHYSICAL_KEY_STATUS`. +- `Support/WebView2Misc.twin` — `Private Module`; helpers, no public surface. +- `EventCallbacks/` — currently empty. + +Public user-facing surface (from `grep '^Public Class' Classes/*.twin` plus the top-level `WebView2` class which has no explicit modifier): + +| Class | Role | +|-----------------------------|-------------------------------------------------------------------------------------------------------| +| `WebView2` | the control itself (`Inherits VB.BaseControlFocusableNoFont`, `[WindowsControl(...)]`) | +| `WebView2Header` | one HTTP header (Name / Value); value type returned by header iteration | +| `WebView2HeadersCollection` | enumerable wrapper used by `For Each` over request / response headers | +| `WebView2Request` | request side of a `WebResourceRequested` event — Method, Uri, Headers, ContentBytes, ContentUTF8 | +| `WebView2RequestHeaders` | mutable request-header collection — `GetHeader`, `Contains`, `AppendHeader`, `RemoveHeader`, … | +| `WebView2Response` | response side of a `WebResourceRequested` event — StatusCode, ReasonPhrase, Headers, ContentBytes… | +| `WebView2ResponseHeaders` | mutable response-header collection | + +`WebView2EnvironmentOptions` is declared `Private Class`, **but** the `WebView2` control exposes it via `Public EnvironmentOptions As WebView2EnvironmentOptions = New WebView2EnvironmentOptions`. Document it as a sub-page of the `WebView2` control class — its `Public` fields (`BrowserExecutableFolder`, `UserDataFolder`, `AdditionalBrowserArguments`, `Language`, `TargetCompatibleBrowserVersion`, `AllowSingleSignOnUsingOSPrimaryAccount`, `ExclusiveUserDataFolderAccess`, `EnableTrackingPrevention`) are user-set before / during the `Create` event. + +The other `Private Class` files (`WebView2DeferredCallback`, `WebView2DeferredRaiseEvent`, `WebView2DevToolsProtocolCallback`, `WebView2ExecuteScriptCompleteHandler`, `WebView2ExecuteScriptCompleteHandler2`) and their helper interfaces (`IDeferredCallback`, `IExecuteScriptCompleteCallback`) are deferral / callback plumbing — skip. + +The `WebView2` class itself is large (~1450 lines) and exposes Properties / Methods / Events plus the `EnvironmentOptions` member. Use the **folder-style** layout (`WebView2/index.md`) like `CheckBox/index.md` so the page can carry a TOC and the optional sub-pages (`WebView2/EnvironmentOptions.md`, etc.) sit beside it. + +Enumerations live in `Support/Enumerations.twin` (module `WebViewEnums`) and currently number ten: `wv2PermissionKind`, `wv2PermissionState`, `wv2ErrorStatus`, `wv2KeyEventKind`, `wv2WebResourceContext`, `wv2ProcessFailedKind`, `wv2ScriptDialogKind`, `wv2HostResourceAccessKind`, `wv2PrintOrientation`, `wv2DefaultDownloadCornerAlign`. Group them under `WebView2Package/Enumerations/` following the VBRUN `Constants/` precedent — one page per enum, with `AlignConstants.md` as the formatting model. + +`COREWEBVIEW2_PHYSICAL_KEY_STATUS` is a public `Type` in the `WebViewTypes` module; it surfaces through the `AcceleratorKeyPressed` event arguments. One page (`WebView2Package/Types/COREWEBVIEW2_PHYSICAL_KEY_STATUS.md`) is enough. + +The package is licensed **MIT** (copyright Wayne Phillips T/A iTech Masters, 2022) — independent of the CC-BY-4.0 VBA-Docs sources. These pages are fully original content; **omit** the `vba_attribution: true` flag, the same as VB-package pages. + +**Navigation title:** display the package as **`WebView2 Package`** (space-separated, dropping the doubled "Package"), even though the folder / URL segment and source-side symbol stay `WebView2Package`. So the index page carries `title: WebView2 Package` while keeping `permalink: /tB/Packages/WebView2Package/`, and every child page sets `parent: WebView2 Package` (matching the title, not the URL segment) — same split that VB / VBRUN already use (`title: VB Package` over `permalink: /tB/Packages/VB/`). + +Pre-existing `WebView2` references on the site to keep aligned: + +- [`docs/Tutorials/WebView2/`](docs/Tutorials/WebView2) — task-oriented tutorial; new reference pages should cross-link to it where useful, and vice versa. +- [`docs/Reference/VBRUN/Constants/ControlTypeConstants.md`](docs/Reference/VBRUN/Constants/ControlTypeConstants.md) — already lists `vbWebView2 = 18`; the new `WebView2` reference page should link to that constant. ## Page template @@ -119,29 +169,45 @@ The URL prefixes are *not* uniform across packages — VBA pages live one segmen - VBA module member → `/tB/Modules//` (legacy scheme retained) - VBRUN module member → `/tB/Packages/VBRUN//` - VB class → `/tB/Packages/VB/`, or `/tB/Packages/VB//` for folder-style classes (one extra segment) +- WebView2 class → `/tB/Packages/WebView2Package/` (or `/tB/Packages/WebView2Package//` for folder-style — used by `WebView2/`) +- WebView2 enumeration → `/tB/Packages/WebView2Package/Enumerations/` (one segment deeper than a class, parallel to VBRUN's `Constants/`) Common patterns: -| From | To | Link | -|-----------------------------------|--------------------------------------|-------------------------------------| -| any page | sibling in same URL folder | `[Y](Y)` | -| VBA `Modules//X` | VBA `Modules//Y` | `[Y](..//Y)` | -| VBA `Modules//X` | `Core/Y` | `[Y](../../Core/Y)` | -| VBA `Modules//X` | VBRUN `Packages/VBRUN//Y` | `[Y](../../Packages/VBRUN//Y)` | -| VBA `Modules//X` | VB `Packages/VB/Y` | `[Y](../../Packages/VB/Y)` | -| VBRUN `Packages/VBRUN//X` | VBRUN `Packages/VBRUN//Y` | `[Y](..//Y)` | -| VBRUN `Packages/VBRUN//X` | `Core/Y` | `[Y](../../../Core/Y)` | -| VBRUN `Packages/VBRUN//X` | VBA `Modules//Y` | `[Y](../../../Modules//Y)` | -| VB `Packages/VB/X` (single-file) | VB `Packages/VB/Y` (sibling) | `[Y](Y)` | -| VB `Packages/VB/X` (single-file) | VBRUN `Packages/VBRUN//Y` | `[Y](../VBRUN//Y)` | -| VB `Packages/VB/X` (single-file) | `Core/Y` | `[Y](../../Core/Y)` | -| VB `Packages/VB//index` | VB `Packages/VB/` | `[Y](../)` | -| VB `Packages/VB//index` | VBRUN `Packages/VBRUN//Y` | `[Y](../../VBRUN//Y)` | -| VB `Packages/VB//index` | `Core/Y` | `[Y](../../../Core/Y)` | -| `Core/X` | VBA `Modules//Y` | `[Y](../Modules//Y)` | -| `Core/X` | VBRUN `Packages/VBRUN//Y` | `[Y](../Packages/VBRUN//Y)` | -| `Core/X` | VB `Packages/VB/Y` | `[Y](../Packages/VB/Y)` | -| `Core/X` | `Core/Y` (sibling) | `[Y](Y)` | +| From | To | Link | +|--------------------------------------------|---------------------------------------------|--------------------------------------------| +| any page | sibling in same URL folder | `[Y](Y)` | +| VBA `Modules//X` | VBA `Modules//Y` | `[Y](..//Y)` | +| VBA `Modules//X` | `Core/Y` | `[Y](../../Core/Y)` | +| VBA `Modules//X` | VBRUN `Packages/VBRUN//Y` | `[Y](../../Packages/VBRUN//Y)` | +| VBA `Modules//X` | VB `Packages/VB/Y` | `[Y](../../Packages/VB/Y)` | +| VBA `Modules//X` | WebView2 `Packages/WebView2Package/Y` | `[Y](../../Packages/WebView2Package/Y)` | +| VBRUN `Packages/VBRUN//X` | VBRUN `Packages/VBRUN//Y` | `[Y](..//Y)` | +| VBRUN `Packages/VBRUN//X` | `Core/Y` | `[Y](../../../Core/Y)` | +| VBRUN `Packages/VBRUN//X` | VBA `Modules//Y` | `[Y](../../../Modules//Y)` | +| VBRUN `Packages/VBRUN//X` | WebView2 `Packages/WebView2Package/Y` | `[Y](../../WebView2Package/Y)` | +| VB `Packages/VB/X` (single-file) | VB `Packages/VB/Y` (sibling) | `[Y](Y)` | +| VB `Packages/VB/X` (single-file) | VBRUN `Packages/VBRUN//Y` | `[Y](../VBRUN//Y)` | +| VB `Packages/VB/X` (single-file) | `Core/Y` | `[Y](../../Core/Y)` | +| VB `Packages/VB//index` | VB `Packages/VB/` | `[Y](../)` | +| VB `Packages/VB//index` | VBRUN `Packages/VBRUN//Y` | `[Y](../../VBRUN//Y)` | +| VB `Packages/VB//index` | `Core/Y` | `[Y](../../../Core/Y)` | +| WebView2 `Packages/WebView2Package/X` (single-file) | sibling `Packages/WebView2Package/Y` | `[Y](Y)` | +| WebView2 `Packages/WebView2Package/X` (single-file) | `Packages/WebView2Package/Enumerations/Y` | `[Y](Enumerations/Y)` | +| WebView2 `Packages/WebView2Package/X` (single-file) | VBRUN `Packages/VBRUN//Y` | `[Y](../VBRUN//Y)` | +| WebView2 `Packages/WebView2Package/X` (single-file) | VB `Packages/VB/Y` | `[Y](../VB/Y)` | +| WebView2 `Packages/WebView2Package/X` (single-file) | `Core/Y` | `[Y](../../Core/Y)` | +| WebView2 `Packages/WebView2Package//index` | sibling `Packages/WebView2Package/Y` | `[Y](../Y)` | +| WebView2 `Packages/WebView2Package//index` | `Packages/WebView2Package/Enumerations/Y` | `[Y](../Enumerations/Y)` | +| WebView2 `Packages/WebView2Package//index` | VBRUN `Packages/VBRUN//Y` | `[Y](../../VBRUN//Y)` | +| WebView2 `Packages/WebView2Package//index` | `Core/Y` | `[Y](../../../Core/Y)` | +| WebView2 `Packages/WebView2Package/Enumerations/X` | sibling `Enumerations/Y` | `[Y](Y)` | +| WebView2 `Packages/WebView2Package/Enumerations/X` | `Packages/WebView2Package/` (single-file) | `[Y](../)` | +| `Core/X` | VBA `Modules//Y` | `[Y](../Modules//Y)` | +| `Core/X` | VBRUN `Packages/VBRUN//Y` | `[Y](../Packages/VBRUN//Y)` | +| `Core/X` | VB `Packages/VB/Y` | `[Y](../Packages/VB/Y)` | +| `Core/X` | WebView2 `Packages/WebView2Package/Y` | `[Y](../Packages/WebView2Package/Y)` | +| `Core/X` | `Core/Y` (sibling) | `[Y](Y)` | Always link to the **canonical** location (the page's `permalink:`), not to a `redirect_from` alias. Pages that have moved out of `Core/` retain a `redirect_from: /tB/Core/` so legacy links still work, but forward-style links should point at the new home. @@ -149,11 +215,15 @@ Always link to the **canonical** location (the page's `permalink:`), not to a `r 1. **Locate the source**: - Core / VBA / VBRUN symbols → `ls ../VBA-Docs/Language/Reference/User-Interface-Help/ | grep -i `. - - VB control classes → `..\AGST-asm\Source\Packages\VB\Sources\CONTROLS\STANDARD\.twin` (and the relevant `BASE/Base*.twin` files for inherited members). + - VB control classes → `..\tb-export\NewProject\Packages\VB\Sources\CONTROLS\STANDARD\.twin` (and the relevant `BASE/Base*.twin` files for inherited members). + - WebView2Package items → `..\tb-export\NewProject\Packages\WebView2Package\Sources\Classes\.twin`, with enumerations in `Support\Enumerations.twin` and the one user-type in `Support\Types.twin`. Ignore everything under `Abstract\` (private COM interfaces). 2. **Decide placement**: - Pure language keyword (parsed by the compiler, no runtime call) → `docs/Reference/Core/`. - Runtime function/property → `docs/Reference///`. Add `redirect_from: /tB/Core/` so legacy `tB/Core/` links still work. - VB control class → `docs/Reference/VB/.md` for a single-file page, or `docs/Reference/VB//index.md` if sub-pages are likely. No `Core/` redirect — these were never under `Core/`. + - WebView2 control / wrapper class → `docs/Reference/WebView2Package/.md` (single-file) or `docs/Reference/WebView2Package//index.md` (folder-style; use this for the main `WebView2` class because of its size). + - WebView2 enumeration → `docs/Reference/WebView2Package/Enumerations/.md`, mirroring `docs/Reference/VBRUN/Constants/`. + - WebView2 user-type → `docs/Reference/WebView2Package/Types/.md`. - Pick `` from VBA's grouping (Information, Interaction, Strings, FileSystem, DateTime, Math, Financial, Conversion, ...) and the existing folders under `Reference//`. 3. **Adapt content** (VBA-Docs sources): - Strip MS frontmatter (`ms.assetid`, `f1_keywords`, `keywords`, `ms.date`, `ms.localizationpriority`). @@ -166,11 +236,16 @@ Always link to the **canonical** location (the page's `permalink:`), not to a `r - List members alphabetically within Properties / Methods / Events sections (see `CheckBox.md`). - Members marked `[Unimplemented]` get a `> [!NOTE]` callout saying so. - Omit the `vba_attribution: true` frontmatter flag — these pages are fully original. -5. **Flag tB deviations** with a `> [!NOTE]` callout (see next section). -6. **Update the parent index** (`//index.md`, `docs/Reference/VB/index.md`, `Reference/Statements.md`, or `Reference/Procedures and Functions.md`) — turn an unlinked bullet into a link with a short blurb. Match the existing style of the page. -7. **Remove the symbol's path from `docs/Reference/VB/todo.md`** `redirect_from:` array (VB controls only — VBA/VBRUN backlogs are closed). -8. **Add the page** to `Reference/Statements.md` or `Reference/Procedures and Functions.md` if it's a statement or callable and not already listed there. -9. **Run the [site integrity check](#site-integrity-check)** after the batch and before committing. +5. **Adapt content** (WebView2Package `.twin` sources): + - For the `WebView2` control: same approach as VB controls — walk the `Inherits VB.BaseControlFocusableNoFont` chain (`..\tb-export\NewProject\Packages\VB\Sources\BASE\BaseControlFocusableNoFont.twin` and ancestors) to know which inherited members are visible. Document the `Public` properties / events declared on `WebView2` itself, plus its `Public Sub` / `Public Function` methods. + - For the wrapper classes (`WebView2Request`, …): they're flat — no inheritance to walk — so list every `Public` member in source order, grouped alphabetically into Properties / Methods. Many `Public` properties on `WebView2EnvironmentOptions` are bare fields, not `Property Get`/`Property Let` pairs; document them as properties of the corresponding type. + - The `[Description("…")]` attribute on each `Public Event` / `Public` field gives the user-visible one-liner from the IDE — use it as the basis for the page's description, then expand. + - Omit the `vba_attribution: true` frontmatter flag — these pages are fully original (the WebView2Package itself is MIT-licensed; CC-BY-4.0 doesn't apply). +6. **Flag tB deviations** with a `> [!NOTE]` callout (see next section). +7. **Update the parent index** (`//index.md`, `docs/Reference/VB/index.md`, `docs/Reference/WebView2Package/index.md`, `Reference/Statements.md`, or `Reference/Procedures and Functions.md`) — turn an unlinked bullet into a link with a short blurb. Match the existing style of the page. +8. **Remove the symbol's path from `docs/Reference/VB/todo.md`** `redirect_from:` array (VB controls only — VBA/VBRUN backlogs are closed; WebView2Package has its own small backlog driven by the package's `Classes/`+`Support/` listing rather than a `todo.md`). +9. **Add the page** to `Reference/Statements.md` or `Reference/Procedures and Functions.md` if it's a statement or callable and not already listed there. +10. **Run the [site integrity check](#site-integrity-check)** after the batch and before committing. ## twinBASIC deviations from VBA to flag @@ -184,18 +259,6 @@ Add a `> [!NOTE]` callout or rewrite the affected section when source diverges. When in doubt about a tB-specific behavior, check `docs/Features/` and `docs/Reference/index.md` before assuming VBA semantics carry over. -## Backlog discovery - -The remaining VB-package classes are tracked in [`docs/Reference/VB/todo.md`](docs/Reference/VB/todo.md) — each pending class appears as a `redirect_from:` entry pointing to its eventual canonical URL. To list what's still open: - -```sh -grep -E "^\s*-\s+/tB/" docs/Reference/VB/todo.md -``` - -The full set of candidates is `..\AGST-asm\Source\Packages\VB\Sources\CONTROLS\STANDARD\*.twin` (plus `CONTROLS\OTHER\` for `ActiveXExtender` and `HwndBaseCtl`). Anything in those folders without a matching page under `docs/Reference/VB/` is undocumented; remove its entry from `todo.md` once its page lands. - -The VBA and VBRUN backlogs are closed — there is no `todo.md` under those folders and no further work is expected there. If a missing symbol surfaces, just create the page directly. - ## Scripts and tooling Any new helper script (backlog reconciliation, content conversion, link checks beyond htmlproofer, etc.) should be written in **Python**. Do not add new Ruby code to this repo. The only Ruby allowed is the existing Jekyll/`just-the-docs` build chain (`Gemfile`, `Gemfile.lock`, `_plugins/`) — that stays as-is. @@ -229,6 +292,6 @@ Favor concise one-line git commit messages. - Don't commit `.claude/` or `CLAUDE.md` — both gitignored. (`WIP.md` is committed; `CLAUDE.md` is just a local `@WIP.md` import shim.) - Don't touch `_site/` (build output, gitignored). - Don't push or force-push without explicit user request. -- Don't invent VBA semantics — read the source file in `../VBA-Docs/` first. For VB controls, read the `.twin` source under `..\AGST-asm\Source\Packages\VB\Sources\` first. +- Don't invent semantics — read the source file in `../VBA-Docs/` first. For twinBASIC-specific packages not documented in VBA-Docs, read the `.twin` sources under `..\tb-export\NewProject\Packages\\Sources\` first. - Don't add boilerplate sections (Remarks, See Also) if the source has nothing meaningful for them. - **Never add `Co-Authored-By:` (or any "Co-authored by" / "Generated with Claude" / similar) trailers to commit messages.** Repository policy. Plain commit messages only. From a0eaf06e4a34fb5b339e5d673635dfe2c8d80b13 Mon Sep 17 00:00:00 2001 From: Kuba Sunderland-Ober Date: Wed, 13 May 2026 13:52:15 +0200 Subject: [PATCH 2/3] Anchor the existing WebView2 tutorial pages. --- docs/Tutorials/WebView2/Customize the UserDataFolder.md | 1 + docs/Tutorials/WebView2/Getting started.md | 3 ++- docs/Tutorials/WebView2/Re-entrancy.md | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/Tutorials/WebView2/Customize the UserDataFolder.md b/docs/Tutorials/WebView2/Customize the UserDataFolder.md index ed2ccbb5..615e61c6 100644 --- a/docs/Tutorials/WebView2/Customize the UserDataFolder.md +++ b/docs/Tutorials/WebView2/Customize the UserDataFolder.md @@ -1,6 +1,7 @@ --- title: Customize the UserDataFolder parent: WebView2 +grand_parent: Tutorials nav_order: 2 permalink: /Tutorials/WebView2/Customize-UserDataFolder redirect_from: diff --git a/docs/Tutorials/WebView2/Getting started.md b/docs/Tutorials/WebView2/Getting started.md index d5ec389e..1741d138 100644 --- a/docs/Tutorials/WebView2/Getting started.md +++ b/docs/Tutorials/WebView2/Getting started.md @@ -1,6 +1,7 @@ --- title: Getting Started parent: WebView2 +grand_parent: Tutorials nav_order: 1 permalink: /Tutorials/WebView2/Getting-Started redirect_from: @@ -40,7 +41,7 @@ There are lots of WebView2 properties and events to experiment with. ![Create Package](Images/tbWebView2Properties.png){:style="width:45%; height:auto;"}

-Note that toggling any property will show extra information at the bottom of the properties list to give you a little bit more information. For further information on a particular property, try searching the official WebView2 documentation +Note that toggling any property will show extra information at the bottom of the properties list to give you a little bit more information. For the full reference, see the [WebView2 control class](../../tB/Packages/WebView2Package/WebView2/); for the underlying browser feature, try searching the official WebView2 documentation ## Samples diff --git a/docs/Tutorials/WebView2/Re-entrancy.md b/docs/Tutorials/WebView2/Re-entrancy.md index 86de5d86..dfd07b73 100644 --- a/docs/Tutorials/WebView2/Re-entrancy.md +++ b/docs/Tutorials/WebView2/Re-entrancy.md @@ -1,6 +1,7 @@ --- title: Re-entrancy parent: WebView2 +grand_parent: Tutorials nav_order: 3 permalink: /Tutorials/WebView2/Re-entrancy redirect_from: From 11f1953f5203ac2872f2800b32006cd85c51205a Mon Sep 17 00:00:00 2001 From: Kuba Sunderland-Ober Date: Wed, 13 May 2026 14:11:50 +0200 Subject: [PATCH 3/3] Document the WebView2 package. --- WIP.md | 2 +- .../VBRUN/Constants/ControlTypeConstants.md | 2 +- docs/Reference/WebView2/Enumerations/index.md | 23 + .../wv2DefaultDownloadCornerAlign.md | 17 + .../WebView2/Enumerations/wv2ErrorStatus.md | 32 + .../Enumerations/wv2HostResourceAccessKind.md | 16 + .../WebView2/Enumerations/wv2KeyEventKind.md | 17 + .../Enumerations/wv2PermissionKind.md | 20 + .../Enumerations/wv2PermissionState.md | 16 + .../Enumerations/wv2PrintOrientation.md | 15 + .../Enumerations/wv2ProcessFailedKind.md | 23 + .../Enumerations/wv2ScriptDialogKind.md | 17 + .../Enumerations/wv2WebResourceContext.md | 30 + .../Types/COREWEBVIEW2_PHYSICAL_KEY_STATUS.md | 46 + docs/Reference/WebView2/Types/index.md | 12 + .../WebView2/WebView2/EnvironmentOptions.md | 74 ++ docs/Reference/WebView2/WebView2/index.md | 920 ++++++++++++++++++ docs/Reference/WebView2/WebView2Header.md | 53 + .../WebView2/WebView2HeadersCollection.md | 40 + docs/Reference/WebView2/WebView2Request.md | 63 ++ .../WebView2/WebView2RequestHeaders.md | 98 ++ docs/Reference/WebView2/WebView2Response.md | 66 ++ .../WebView2/WebView2ResponseHeaders.md | 83 ++ docs/Reference/WebView2/index.md | 43 + docs/Tutorials/WebView2/Getting started.md | 2 +- 25 files changed, 1727 insertions(+), 3 deletions(-) create mode 100644 docs/Reference/WebView2/Enumerations/index.md create mode 100644 docs/Reference/WebView2/Enumerations/wv2DefaultDownloadCornerAlign.md create mode 100644 docs/Reference/WebView2/Enumerations/wv2ErrorStatus.md create mode 100644 docs/Reference/WebView2/Enumerations/wv2HostResourceAccessKind.md create mode 100644 docs/Reference/WebView2/Enumerations/wv2KeyEventKind.md create mode 100644 docs/Reference/WebView2/Enumerations/wv2PermissionKind.md create mode 100644 docs/Reference/WebView2/Enumerations/wv2PermissionState.md create mode 100644 docs/Reference/WebView2/Enumerations/wv2PrintOrientation.md create mode 100644 docs/Reference/WebView2/Enumerations/wv2ProcessFailedKind.md create mode 100644 docs/Reference/WebView2/Enumerations/wv2ScriptDialogKind.md create mode 100644 docs/Reference/WebView2/Enumerations/wv2WebResourceContext.md create mode 100644 docs/Reference/WebView2/Types/COREWEBVIEW2_PHYSICAL_KEY_STATUS.md create mode 100644 docs/Reference/WebView2/Types/index.md create mode 100644 docs/Reference/WebView2/WebView2/EnvironmentOptions.md create mode 100644 docs/Reference/WebView2/WebView2/index.md create mode 100644 docs/Reference/WebView2/WebView2Header.md create mode 100644 docs/Reference/WebView2/WebView2HeadersCollection.md create mode 100644 docs/Reference/WebView2/WebView2Request.md create mode 100644 docs/Reference/WebView2/WebView2RequestHeaders.md create mode 100644 docs/Reference/WebView2/WebView2Response.md create mode 100644 docs/Reference/WebView2/WebView2ResponseHeaders.md create mode 100644 docs/Reference/WebView2/index.md diff --git a/WIP.md b/WIP.md index 0583887f..0ccc479f 100644 --- a/WIP.md +++ b/WIP.md @@ -11,7 +11,7 @@ Status: - **VBA package** — done. - **VBRUN package** — done. - **VB package** — done. -- **WebView2Package** — in progress. +- **WebView2Package** — done. ## Where things live diff --git a/docs/Reference/VBRUN/Constants/ControlTypeConstants.md b/docs/Reference/VBRUN/Constants/ControlTypeConstants.md index 4017e7d8..35c87d70 100644 --- a/docs/Reference/VBRUN/Constants/ControlTypeConstants.md +++ b/docs/Reference/VBRUN/Constants/ControlTypeConstants.md @@ -29,7 +29,7 @@ Identifiers for the standard intrinsic and bundled control types, used by runtim | **vbDriveListBox**{: #vbDriveListBox } | 15 | A drive list-box. | | **vbFileListBox**{: #vbFileListBox } | 16 | A file list-box. | | **vbForm**{: #vbForm } | 17 | A form. | -| **vbWebView2**{: #vbWebView2 } | 18 | A WebView2 control (twinBASIC). | +| **vbWebView2**{: #vbWebView2 } | 18 | A [**WebView2**](../../WebView2/WebView2/) control. | | **vbActiveXExtender**{: #vbActiveXExtender } | 19 | An ActiveX extender wrapper. | | **vbShape**{: #vbShape } | 20 | A shape control. | | **vbProgressBar**{: #vbProgressBar } | 21 | A progress-bar control. | diff --git a/docs/Reference/WebView2/Enumerations/index.md b/docs/Reference/WebView2/Enumerations/index.md new file mode 100644 index 00000000..0d57d467 --- /dev/null +++ b/docs/Reference/WebView2/Enumerations/index.md @@ -0,0 +1,23 @@ +--- +title: Enumerations +parent: WebView2 Package +permalink: /tB/Packages/WebView2/Enumerations/ +has_toc: false +--- + +# Enumerations + +The `wv2…` enumerations used by the **WebView2** control's properties, methods, and event arguments. Their members carry the constant value defined by the underlying `COREWEBVIEW2_*` enumeration in the Edge WebView2 runtime — the comment beside each `Enum` in the source records the runtime name. + +| Enumeration | Used by | +|-------------|---------| +| [wv2DefaultDownloadCornerAlign](wv2DefaultDownloadCornerAlign) | corner alignment of the built-in download dialog | +| [wv2ErrorStatus](wv2ErrorStatus) | `WebErrorStatus` on **NavigationComplete** | +| [wv2HostResourceAccessKind](wv2HostResourceAccessKind) | **SetVirtualHostNameToFolderMapping** | +| [wv2KeyEventKind](wv2KeyEventKind) | `KeyState` on **AcceleratorKeyPressed** | +| [wv2PermissionKind](wv2PermissionKind) | `PermissionKind` on **PermissionRequested** | +| [wv2PermissionState](wv2PermissionState) | `State` on **PermissionRequested** | +| [wv2PrintOrientation](wv2PrintOrientation) | `Orientation` on **PrintToPdf** | +| [wv2ProcessFailedKind](wv2ProcessFailedKind) | `Kind` on **ProcessFailed** | +| [wv2ScriptDialogKind](wv2ScriptDialogKind) | `ScriptDialogKind` on **ScriptDialogOpening** | +| [wv2WebResourceContext](wv2WebResourceContext) | `FilterContext` on **AddWebResourceRequestedFilter** / **RemoveWebResourceRequestedFilter** | diff --git a/docs/Reference/WebView2/Enumerations/wv2DefaultDownloadCornerAlign.md b/docs/Reference/WebView2/Enumerations/wv2DefaultDownloadCornerAlign.md new file mode 100644 index 00000000..009a42f8 --- /dev/null +++ b/docs/Reference/WebView2/Enumerations/wv2DefaultDownloadCornerAlign.md @@ -0,0 +1,17 @@ +--- +title: wv2DefaultDownloadCornerAlign +parent: Enumerations +grand_parent: WebView2 Package +permalink: /tB/Packages/WebView2/Enumerations/wv2DefaultDownloadCornerAlign +--- +# wv2DefaultDownloadCornerAlign +{: .no_toc } + +Anchors the built-in download-progress dialog to one corner of the WebView2 control. Mirrors the `COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT` enumeration. + +| Constant | Value | Description | +|----------|-------|-------------| +| **wv2CornerTopLeft**{: #wv2CornerTopLeft } | 0 | Top-left corner. | +| **wv2CornerTopRight**{: #wv2CornerTopRight } | 1 | Top-right corner. | +| **wv2CornerBottomLeft**{: #wv2CornerBottomLeft } | 2 | Bottom-left corner. | +| **wv2CornerBottomRight**{: #wv2CornerBottomRight } | 3 | Bottom-right corner. | diff --git a/docs/Reference/WebView2/Enumerations/wv2ErrorStatus.md b/docs/Reference/WebView2/Enumerations/wv2ErrorStatus.md new file mode 100644 index 00000000..799bd4d1 --- /dev/null +++ b/docs/Reference/WebView2/Enumerations/wv2ErrorStatus.md @@ -0,0 +1,32 @@ +--- +title: wv2ErrorStatus +parent: Enumerations +grand_parent: WebView2 Package +permalink: /tB/Packages/WebView2/Enumerations/wv2ErrorStatus +--- +# wv2ErrorStatus +{: .no_toc } + +The reason a navigation failed. Carried as the `WebErrorStatus` argument of the [**NavigationComplete**](../WebView2/#navigationcomplete) event — only meaningful when its `IsSuccess` argument is **False**. Mirrors the `COREWEBVIEW2_WEB_ERROR_STATUS` enumeration. + +| Constant | Value | Description | +|----------|-------|-------------| +| **wv2StateUnknown**{: #wv2StateUnknown } | 0 | An unspecified or unrecognised error. | +| **wv2CertificateCommonNameIsIncorrect**{: #wv2CertificateCommonNameIsIncorrect } | 1 | The server certificate's common name doesn't match the requested host. | +| **wv2CertificateExpired**{: #wv2CertificateExpired } | 2 | The server certificate has expired. | +| **wv2ClientCertificateContainsErrors**{: #wv2ClientCertificateContainsErrors } | 3 | The client certificate contains errors. | +| **wv2CertificateRevoked**{: #wv2CertificateRevoked } | 4 | The server certificate has been revoked. | +| **wv2CertificateIsInvalid**{: #wv2CertificateIsInvalid } | 5 | The server certificate is otherwise invalid. | +| **wv2ServerUnreachable**{: #wv2ServerUnreachable } | 6 | The server could not be reached. | +| **wv2Timeout**{: #wv2Timeout } | 7 | The connection or request timed out. | +| **wv2ErrorHttpInvalidServerResponse**{: #wv2ErrorHttpInvalidServerResponse } | 8 | The server returned a malformed HTTP response. | +| **wv2ConnectionAborted**{: #wv2ConnectionAborted } | 9 | The connection was aborted. | +| **wv2ConnectionReset**{: #wv2ConnectionReset } | 10 | The connection was reset. | +| **wv2Disconnected**{: #wv2Disconnected } | 11 | The connection was disconnected. | +| **wv2CannotConnect**{: #wv2CannotConnect } | 12 | A connection could not be established. | +| **wv2HostNameNotResolved**{: #wv2HostNameNotResolved } | 13 | DNS lookup failed. | +| **wv2OperationCanceled**{: #wv2OperationCanceled } | 14 | The navigation was cancelled. | +| **wv2RedirectFailed**{: #wv2RedirectFailed } | 15 | A redirect could not be followed. | +| **wv2UnexpectedError**{: #wv2UnexpectedError } | 16 | An unexpected error occurred. | +| **wv2ValidAuthenticationCredentialsRequired**{: #wv2ValidAuthenticationCredentialsRequired } | 17 | The server demanded credentials. | +| **wv2ValidProxyAuthenticationRequired**{: #wv2ValidProxyAuthenticationRequired } | 18 | The configured proxy demanded credentials. | diff --git a/docs/Reference/WebView2/Enumerations/wv2HostResourceAccessKind.md b/docs/Reference/WebView2/Enumerations/wv2HostResourceAccessKind.md new file mode 100644 index 00000000..e6d283b8 --- /dev/null +++ b/docs/Reference/WebView2/Enumerations/wv2HostResourceAccessKind.md @@ -0,0 +1,16 @@ +--- +title: wv2HostResourceAccessKind +parent: Enumerations +grand_parent: WebView2 Package +permalink: /tB/Packages/WebView2/Enumerations/wv2HostResourceAccessKind +--- +# wv2HostResourceAccessKind +{: .no_toc } + +How the WebView2 runtime should treat a virtual hostname mapped to a local folder by [**SetVirtualHostNameToFolderMapping**](../WebView2/#setvirtualhostnametofoldermapping) — whether pages on other origins are allowed to fetch from it. Mirrors the `COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND` enumeration. + +| Constant | Value | Description | +|----------|-------|-------------| +| **wv2ResourceDeny**{: #wv2ResourceDeny } | 0 | Only pages served from the same virtual hostname may load resources from the mapped folder. | +| **wv2ResourceAllow**{: #wv2ResourceAllow } | 1 | Default — any page may load resources from the mapped folder. | +| **wv2ResourceDenyCors**{: #wv2ResourceDenyCors } | 2 | Same as **wv2ResourceAllow**, but cross-origin requests are subject to the usual CORS checks. | diff --git a/docs/Reference/WebView2/Enumerations/wv2KeyEventKind.md b/docs/Reference/WebView2/Enumerations/wv2KeyEventKind.md new file mode 100644 index 00000000..1273bd98 --- /dev/null +++ b/docs/Reference/WebView2/Enumerations/wv2KeyEventKind.md @@ -0,0 +1,17 @@ +--- +title: wv2KeyEventKind +parent: Enumerations +grand_parent: WebView2 Package +permalink: /tB/Packages/WebView2/Enumerations/wv2KeyEventKind +--- +# wv2KeyEventKind +{: .no_toc } + +The kind of accelerator-key keyboard message that fired the [**AcceleratorKeyPressed**](../WebView2/#acceleratorkeypressed) event, carried as its **ByRef** `KeyState` argument. Mirrors the `COREWEBVIEW2_KEY_EVENT_KIND` enumeration. + +| Constant | Value | Description | +|----------|-------|-------------| +| **wv2EventKeyDown**{: #wv2EventKeyDown } | 0 | Raised from a `WM_KEYDOWN` message. | +| **wv2EventKeyUp**{: #wv2EventKeyUp } | 1 | Raised from a `WM_KEYUP` message. | +| **wv2EventSystemKeyDown**{: #wv2EventSystemKeyDown } | 2 | Raised from a `WM_SYSKEYDOWN` message — e.g. **Alt+** *key*. | +| **wv2EventSystemKeyUp**{: #wv2EventSystemKeyUp } | 3 | Raised from a `WM_SYSKEYUP` message. | diff --git a/docs/Reference/WebView2/Enumerations/wv2PermissionKind.md b/docs/Reference/WebView2/Enumerations/wv2PermissionKind.md new file mode 100644 index 00000000..3681bd14 --- /dev/null +++ b/docs/Reference/WebView2/Enumerations/wv2PermissionKind.md @@ -0,0 +1,20 @@ +--- +title: wv2PermissionKind +parent: Enumerations +grand_parent: WebView2 Package +permalink: /tB/Packages/WebView2/Enumerations/wv2PermissionKind +--- +# wv2PermissionKind +{: .no_toc } + +Identifies which device or browser capability a web page is asking permission to use. Carried as the `PermissionKind` argument of the [**PermissionRequested**](../WebView2/#permissionrequested) event. Mirrors the `COREWEBVIEW2_PERMISSION_KIND` enumeration in the Edge WebView2 runtime. + +| Constant | Value | Description | +|----------|-------|-------------| +| **wv2UnknownPermission**{: #wv2UnknownPermission } | 0 | Permission kind not recognised by the runtime. | +| **wv2Microphone**{: #wv2Microphone } | 1 | Permission to capture audio from the user's microphone. | +| **wv2Camera**{: #wv2Camera } | 2 | Permission to capture video from the user's camera. | +| **wv2Geolocation**{: #wv2Geolocation } | 3 | Permission to read the device's geographic location. | +| **wv2Notifications**{: #wv2Notifications } | 4 | Permission to show desktop notifications. | +| **wv2Sensors**{: #wv2Sensors } | 5 | Permission to read motion, orientation, light, and similar sensors. | +| **wv2ClipboardRead**{: #wv2ClipboardRead } | 6 | Permission to read the system clipboard. | diff --git a/docs/Reference/WebView2/Enumerations/wv2PermissionState.md b/docs/Reference/WebView2/Enumerations/wv2PermissionState.md new file mode 100644 index 00000000..595bf24a --- /dev/null +++ b/docs/Reference/WebView2/Enumerations/wv2PermissionState.md @@ -0,0 +1,16 @@ +--- +title: wv2PermissionState +parent: Enumerations +grand_parent: WebView2 Package +permalink: /tB/Packages/WebView2/Enumerations/wv2PermissionState +--- +# wv2PermissionState +{: .no_toc } + +The host's decision on a permission request. Carried as the **ByRef** `State` argument of the [**PermissionRequested**](../WebView2/#permissionrequested) event — assign one of these values to control whether the page is granted, denied, or left to the runtime's default behaviour. Mirrors the `COREWEBVIEW2_PERMISSION_STATE` enumeration. + +| Constant | Value | Description | +|----------|-------|-------------| +| **wv2StateDefault**{: #wv2StateDefault } | 0 | Let the runtime decide — typically prompts the user. | +| **wv2StateAllow**{: #wv2StateAllow } | 1 | Grant the permission silently. | +| **wv2StateDeny**{: #wv2StateDeny } | 2 | Deny the permission silently. | diff --git a/docs/Reference/WebView2/Enumerations/wv2PrintOrientation.md b/docs/Reference/WebView2/Enumerations/wv2PrintOrientation.md new file mode 100644 index 00000000..1e9f6f08 --- /dev/null +++ b/docs/Reference/WebView2/Enumerations/wv2PrintOrientation.md @@ -0,0 +1,15 @@ +--- +title: wv2PrintOrientation +parent: Enumerations +grand_parent: WebView2 Package +permalink: /tB/Packages/WebView2/Enumerations/wv2PrintOrientation +--- +# wv2PrintOrientation +{: .no_toc } + +Page orientation passed to [**PrintToPdf**](../WebView2/#printtopdf) when writing the current document to a PDF file. Mirrors the `COREWEBVIEW2_PRINT_ORIENTATION` enumeration. + +| Constant | Value | Description | +|----------|-------|-------------| +| **wv2PrintPortrait**{: #wv2PrintPortrait } | 0 | Default — pages are laid out with the long side vertical. | +| **wv2PrintLandscape**{: #wv2PrintLandscape } | 1 | Pages are laid out with the long side horizontal. | diff --git a/docs/Reference/WebView2/Enumerations/wv2ProcessFailedKind.md b/docs/Reference/WebView2/Enumerations/wv2ProcessFailedKind.md new file mode 100644 index 00000000..1c4f6a81 --- /dev/null +++ b/docs/Reference/WebView2/Enumerations/wv2ProcessFailedKind.md @@ -0,0 +1,23 @@ +--- +title: wv2ProcessFailedKind +parent: Enumerations +grand_parent: WebView2 Package +permalink: /tB/Packages/WebView2/Enumerations/wv2ProcessFailedKind +--- +# wv2ProcessFailedKind +{: .no_toc } + +Identifies which of the external WebView2 processes failed. Carried as the `Kind` argument of the [**ProcessFailed**](../WebView2/#processfailed) event. Mirrors the `COREWEBVIEW2_PROCESS_FAILED_KIND` enumeration. + +| Constant | Value | Description | +|----------|-------|-------------| +| **wv2BrowserProcessExited**{: #wv2BrowserProcessExited } | 0 | The main browser process exited unexpectedly — the control cannot be recovered. | +| **wv2RenderProcessExited**{: #wv2RenderProcessExited } | 1 | The renderer process exited unexpectedly. | +| **wv2RenderProcessUnresponsive**{: #wv2RenderProcessUnresponsive } | 2 | The renderer process is hung. | +| **wv2FrameRenderProcessExited**{: #wv2FrameRenderProcessExited } | 3 | A renderer process for one of the iframes exited. | +| **wv2UtilityProcessExited**{: #wv2UtilityProcessExited } | 4 | A utility process exited. | +| **wv2SandboxHelperProcessExited**{: #wv2SandboxHelperProcessExited } | 5 | The sandbox helper process exited. | +| **wv2GpuProcessExited**{: #wv2GpuProcessExited } | 6 | The GPU process exited. | +| **wv2PpapiPluginProcessExited**{: #wv2PpapiPluginProcessExited } | 7 | A PPAPI plug-in process exited. | +| **wv2PpapiBrokerProcessExited**{: #wv2PpapiBrokerProcessExited } | 8 | The PPAPI broker process exited. | +| **wv2UnknownProcessExited**{: #wv2UnknownProcessExited } | 9 | An unidentified WebView2 process exited. | diff --git a/docs/Reference/WebView2/Enumerations/wv2ScriptDialogKind.md b/docs/Reference/WebView2/Enumerations/wv2ScriptDialogKind.md new file mode 100644 index 00000000..b5fac7aa --- /dev/null +++ b/docs/Reference/WebView2/Enumerations/wv2ScriptDialogKind.md @@ -0,0 +1,17 @@ +--- +title: wv2ScriptDialogKind +parent: Enumerations +grand_parent: WebView2 Package +permalink: /tB/Packages/WebView2/Enumerations/wv2ScriptDialogKind +--- +# wv2ScriptDialogKind +{: .no_toc } + +Identifies which JavaScript-dialog primitive the page is trying to open. Carried as the `ScriptDialogKind` argument of the [**ScriptDialogOpening**](../WebView2/#scriptdialogopening) event — the event only fires when **AreDefaultScriptDialogsEnabled** is **False**, so the application can implement its own dialogs. Mirrors the `COREWEBVIEW2_SCRIPT_DIALOG_KIND` enumeration. + +| Constant | Value | Description | +|----------|-------|-------------| +| **wv2DialogAlert**{: #wv2DialogAlert } | 0 | `alert()` — a single-message notification with an *OK* button. | +| **wv2DialogConfirm**{: #wv2DialogConfirm } | 1 | `confirm()` — a question with *OK* and *Cancel*. | +| **wv2DialogPrompt**{: #wv2DialogPrompt } | 2 | `prompt()` — a text-input question with *OK* and *Cancel*. | +| **wv2DialogBeforeUnload**{: #wv2DialogBeforeUnload } | 3 | The browser's *Leave this page?* confirmation raised by `beforeunload`. | diff --git a/docs/Reference/WebView2/Enumerations/wv2WebResourceContext.md b/docs/Reference/WebView2/Enumerations/wv2WebResourceContext.md new file mode 100644 index 00000000..87206a7f --- /dev/null +++ b/docs/Reference/WebView2/Enumerations/wv2WebResourceContext.md @@ -0,0 +1,30 @@ +--- +title: wv2WebResourceContext +parent: Enumerations +grand_parent: WebView2 Package +permalink: /tB/Packages/WebView2/Enumerations/wv2WebResourceContext +--- +# wv2WebResourceContext +{: .no_toc } + +The kind of HTTP request a filter should match when registered with [**AddWebResourceRequestedFilter**](../WebView2/#addwebresourcerequestedfilter) (or removed with [**RemoveWebResourceRequestedFilter**](../WebView2/#removewebresourcerequestedfilter)). Mirrors the `COREWEBVIEW2_WEB_RESOURCE_CONTEXT` enumeration. + +| Constant | Value | Description | +|----------|-------|-------------| +| **wv2All**{: #wv2All } | 0 | Match every request, irrespective of kind. | +| **wv2Document**{: #wv2Document } | 1 | Top-level HTML document. | +| **wv2Stylesheet**{: #wv2Stylesheet } | 2 | CSS stylesheet. | +| **wv2Image**{: #wv2Image } | 3 | Image resource. | +| **wv2Media**{: #wv2Media } | 4 | Audio or video resource. | +| **wv2Font**{: #wv2Font } | 5 | Web-font resource. | +| **wv2Script**{: #wv2Script } | 6 | JavaScript file. | +| **wv2XMLHttpRequest**{: #wv2XMLHttpRequest } | 7 | `XMLHttpRequest` (XHR) call. | +| **wv2Fetch**{: #wv2Fetch } | 8 | `fetch()` API call. | +| **wv2TextTrack**{: #wv2TextTrack } | 9 | Text track for `