Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 110 additions & 47 deletions WIP.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/Reference/VBRUN/Constants/ControlTypeConstants.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
23 changes: 23 additions & 0 deletions docs/Reference/WebView2/Enumerations/index.md
Original file line number Diff line number Diff line change
@@ -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** |
Original file line number Diff line number Diff line change
@@ -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. |
32 changes: 32 additions & 0 deletions docs/Reference/WebView2/Enumerations/wv2ErrorStatus.md
Original file line number Diff line number Diff line change
@@ -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. |
16 changes: 16 additions & 0 deletions docs/Reference/WebView2/Enumerations/wv2HostResourceAccessKind.md
Original file line number Diff line number Diff line change
@@ -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. |
17 changes: 17 additions & 0 deletions docs/Reference/WebView2/Enumerations/wv2KeyEventKind.md
Original file line number Diff line number Diff line change
@@ -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. |
20 changes: 20 additions & 0 deletions docs/Reference/WebView2/Enumerations/wv2PermissionKind.md
Original file line number Diff line number Diff line change
@@ -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. |
16 changes: 16 additions & 0 deletions docs/Reference/WebView2/Enumerations/wv2PermissionState.md
Original file line number Diff line number Diff line change
@@ -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. |
15 changes: 15 additions & 0 deletions docs/Reference/WebView2/Enumerations/wv2PrintOrientation.md
Original file line number Diff line number Diff line change
@@ -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. |
23 changes: 23 additions & 0 deletions docs/Reference/WebView2/Enumerations/wv2ProcessFailedKind.md
Original file line number Diff line number Diff line change
@@ -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. |
17 changes: 17 additions & 0 deletions docs/Reference/WebView2/Enumerations/wv2ScriptDialogKind.md
Original file line number Diff line number Diff line change
@@ -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`. |
30 changes: 30 additions & 0 deletions docs/Reference/WebView2/Enumerations/wv2WebResourceContext.md
Original file line number Diff line number Diff line change
@@ -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 `<video>` / `<audio>`. |
| **wv2EventSource**{: #wv2EventSource } | 10 | Server-sent-events stream. |
| **wv2WebSocket**{: #wv2WebSocket } | 11 | WebSocket connection. |
| **wv2Manifest**{: #wv2Manifest } | 12 | Web-app manifest. |
| **wv2SignedExchange**{: #wv2SignedExchange } | 13 | Signed-HTTP-exchange resource. |
| **wv2Ping**{: #wv2Ping } | 14 | Hyperlink ping request. |
| **wv2CspViolationReport**{: #wv2CspViolationReport } | 15 | Content-Security-Policy violation report. |
| **wv2Other**{: #wv2Other } | 16 | A request not covered by the other kinds. |
46 changes: 46 additions & 0 deletions docs/Reference/WebView2/Types/COREWEBVIEW2_PHYSICAL_KEY_STATUS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: COREWEBVIEW2_PHYSICAL_KEY_STATUS
parent: Types
grand_parent: WebView2 Package
permalink: /tB/Packages/WebView2/Types/COREWEBVIEW2_PHYSICAL_KEY_STATUS
---
# COREWEBVIEW2_PHYSICAL_KEY_STATUS
{: .no_toc }

The bit-fields the Win32 `WM_KEYDOWN` / `WM_KEYUP` message family packs into its `lParam`, decoded into a record. The control reads the runtime's `COREWEBVIEW2_PHYSICAL_KEY_STATUS` structure on each accelerator keystroke and splays it across individual arguments of the [**AcceleratorKeyPressed**](../WebView2/#acceleratorkeypressed) event — application code does not normally create instances of this type directly.

```tb
Public Type COREWEBVIEW2_PHYSICAL_KEY_STATUS
RepeatCount As Long
ScanCode As Long
IsExtendedKey As Long
IsMenuKeyDown As Long
WasKeyDown As Long
IsKeyReleased As Long
End Type
```

## Members

*RepeatCount*
: How many times the keystroke is auto-repeated as the message is held in the queue.

*ScanCode*
: The hardware scan code of the pressed key.

*IsExtendedKey*
: Non-zero when the key is one of the *extended* keys — right-hand **Alt** / **Ctrl**, the arrow / **Home** / **End** / **Page Up** / **Page Down** / **Insert** / **Delete** block, **NumLock**, and the numeric-keypad **Enter** and **/**.

*IsMenuKeyDown*
: Non-zero when **Alt** was held while the message was generated.

*WasKeyDown*
: Non-zero when the key was already down before this message — distinguishes the initial keystroke from subsequent auto-repeats.

*IsKeyReleased*
: Non-zero on the transition message reporting the key going up; zero on key-down messages.

### See Also

- [AcceleratorKeyPressed](../WebView2/#acceleratorkeypressed)
- [wv2KeyEventKind](../Enumerations/wv2KeyEventKind)
12 changes: 12 additions & 0 deletions docs/Reference/WebView2/Types/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Types
parent: WebView2 Package
permalink: /tB/Packages/WebView2/Types/
has_toc: false
---

# Types

Public user-defined `Type` declarations in the package. Currently a single value type, used to unpack the physical-key-status payload of one event.

- [COREWEBVIEW2_PHYSICAL_KEY_STATUS](COREWEBVIEW2_PHYSICAL_KEY_STATUS) -- repeat-count / scan-code / extended-key / menu-key / key-down / key-released flags read off the **AcceleratorKeyPressed** event
Loading