From 57f9583e4d57a63513f400599936e891d66e1880 Mon Sep 17 00:00:00 2001 From: "kernel-internal[bot]" <260533166+kernel-internal[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2026 15:13:20 +0000 Subject: [PATCH 1/2] feat: Mirror the control/platform telemetry split into the public API Stainless-Generated-From: 693b2d70cc71724e1de6a9d1b28471b24eb9042d --- api.md | 9 + authconnection.go | 122 +- authconnection_test.go | 48 +- browser.go | 26 +- browser_test.go | 16 +- browserpool.go | 36 +- browserpool_test.go | 24 +- browsertelemetry.go | 3851 ++++++++++++++++++++++++++++++++-- proxy.go | 5 +- shared/constant/constants.go | 388 ++-- 10 files changed, 4136 insertions(+), 389 deletions(-) diff --git a/api.md b/api.md index 17139df..1e386b3 100644 --- a/api.md +++ b/api.md @@ -106,14 +106,19 @@ Methods: Params Types: +- kernel.BrowserCdpCommandMethod - kernel.BrowserTelemetryCategoriesConfigParam - kernel.BrowserTelemetryCategoryConfigParam +- kernel.BrowserTelemetryCdpControlConfigParam +- kernel.BrowserTelemetryControlConfigParam Response Types: - kernel.BrowserAPICallEvent - kernel.BrowserCallStack - kernel.BrowserCaptchaSolveResultEvent +- kernel.BrowserCdpCommandEvent +- kernel.BrowserCdpCommandMethod - kernel.BrowserCdpConnectEvent - kernel.BrowserCdpDisconnectEvent - kernel.BrowserConsoleErrorEvent @@ -135,6 +140,7 @@ Response Types: - kernel.BrowserNetworkLoadingFailedEvent - kernel.BrowserNetworkRequestEvent - kernel.BrowserNetworkResponseEvent +- kernel.BrowserPageCrashedEvent - kernel.BrowserPageDomContentLoadedEvent - kernel.BrowserPageLayoutSettledEvent - kernel.BrowserPageLayoutShiftEvent @@ -143,12 +149,15 @@ Response Types: - kernel.BrowserPageNavigationEvent - kernel.BrowserPageNavigationSettledEvent - kernel.BrowserPageTabOpenedEvent +- kernel.BrowserPlatformAPICallEvent - kernel.BrowserProxyErrorEvent - kernel.BrowserServiceCrashedEvent - kernel.BrowserSystemOomKillEvent - kernel.BrowserTelemetryCategoriesConfig - kernel.BrowserTelemetryCategoryConfig +- kernel.BrowserTelemetryCdpControlConfig - kernel.BrowserTelemetryConfig +- kernel.BrowserTelemetryControlConfig - kernel.BrowserTelemetryEventUnion - kernel.BrowserTelemetryExportConfig - kernel.BrowserTelemetryOtlpExportConfig diff --git a/authconnection.go b/authconnection.go index 1e30982..c955cfe 100644 --- a/authconnection.go +++ b/authconnection.go @@ -308,34 +308,34 @@ type ManagedAuth struct { // Machine-readable reason for the current value of `can_reauth`. Affirmative // values (re-auth is possible): // - // - `external_credential` — an external credential provider is attached - // - `cua_has_credential` — CUA flow with a stored credential - // - `has_credential` — Kernel credential is attached (optimistic; plan viability - // not checked) - // - `viable_plans_found` — at least one stored login plan can be replayed - // - `no_requirements_recorded` — no recorded credential requirements to fail - // against - // - `requirements_satisfiable` — recorded requirements can be met by the attached - // credential + // - `external_credential` — an external credential provider is attached + // - `cua_has_credential` — CUA flow with a stored credential + // - `has_credential` — Kernel credential is attached (optimistic; plan viability + // not checked) + // - `viable_plans_found` — at least one stored login plan can be replayed + // - `no_requirements_recorded` — no recorded credential requirements to fail + // against + // - `requirements_satisfiable` — recorded requirements can be met by the attached + // credential // // Negative values (a human must complete the login flow): // - // - `no_prior_successful_login` — connection has never completed a successful - // login - // - `no_credential` — no Kernel or external credential attached - // - `no_viable_plans` — credential attached but no replayable login plan exists - // yet - // - `viable_plans_require_external_action` — stored plans need an external step - // (email link, push, etc.) - // - `requires_external_action` — recorded requirements include an external step - // - `requires_totp_without_secret` — flow needs a TOTP code but no TOTP secret is - // stored - // - `requires_sms_code` — flow needs an SMS code that cannot be received - // automatically - // - `requires_email_code` — flow needs an email code that cannot be received - // automatically - // - `requires_customer_input` — flow needs another field or choice that is - // unavailable during unattended re-authentication + // - `no_prior_successful_login` — connection has never completed a successful + // login + // - `no_credential` — no Kernel or external credential attached + // - `no_viable_plans` — credential attached but no replayable login plan exists + // yet + // - `viable_plans_require_external_action` — stored plans need an external step + // (email link, push, etc.) + // - `requires_external_action` — recorded requirements include an external step + // - `requires_totp_without_secret` — flow needs a TOTP code but no TOTP secret is + // stored + // - `requires_sms_code` — flow needs an SMS code that cannot be received + // automatically + // - `requires_email_code` — flow needs an email code that cannot be received + // automatically + // - `requires_customer_input` — flow needs another field or choice that is + // unavailable during unattended re-authentication // // Any of "external_credential", "cua_has_credential", "has_credential", // "viable_plans_found", "no_requirements_recorded", "requirements_satisfiable", @@ -508,12 +508,12 @@ type ManagedAuthBrowserTelemetry struct { // Per-category capture flags. The operational categories (control, connection, // system, captcha) are captured whenever telemetry is enabled; set one to // enabled=false to opt out. The CDP categories (console, network, page, - // interaction) and screenshot are off by default; set enabled=true to opt in. On - // create, provided categories layer onto the default set. On update, provided - // categories merge onto the session's current config; when no telemetry is active - // this falls back to the default set (matching create). If browser is omitted or - // empty, the default set is used. A browser config that disables every category - // stops capture on update and starts no capture on create. + // interaction), screenshot and platform are off by default; set enabled=true to + // opt in. On create, provided categories layer onto the default set. On update, + // provided categories merge onto the session's current config; when no telemetry + // is active this falls back to the default set (matching create). If browser is + // omitted or empty, the default set is used. A browser config that disables every + // category stops capture on update and starts no capture on create. Browser BrowserTelemetryCategoriesConfig `json:"browser"` // Request shortcut for browser telemetry capture. True enables capture; with no // browser category settings it captures the default set (control, connection, @@ -981,12 +981,12 @@ type ManagedAuthBrowserConfigTelemetry struct { // Per-category capture flags. The operational categories (control, connection, // system, captcha) are captured whenever telemetry is enabled; set one to // enabled=false to opt out. The CDP categories (console, network, page, - // interaction) and screenshot are off by default; set enabled=true to opt in. On - // create, provided categories layer onto the default set. On update, provided - // categories merge onto the session's current config; when no telemetry is active - // this falls back to the default set (matching create). If browser is omitted or - // empty, the default set is used. A browser config that disables every category - // stops capture on update and starts no capture on create. + // interaction), screenshot and platform are off by default; set enabled=true to + // opt in. On create, provided categories layer onto the default set. On update, + // provided categories merge onto the session's current config; when no telemetry + // is active this falls back to the default set (matching create). If browser is + // omitted or empty, the default set is used. A browser config that disables every + // category stops capture on update and starts no capture on create. Browser BrowserTelemetryCategoriesConfig `json:"browser"` // Request shortcut for browser telemetry capture. True enables capture; with no // browser category settings it captures the default set (control, connection, @@ -1119,12 +1119,12 @@ type ManagedAuthBrowserConfigTelemetryParam struct { // Per-category capture flags. The operational categories (control, connection, // system, captcha) are captured whenever telemetry is enabled; set one to // enabled=false to opt out. The CDP categories (console, network, page, - // interaction) and screenshot are off by default; set enabled=true to opt in. On - // create, provided categories layer onto the default set. On update, provided - // categories merge onto the session's current config; when no telemetry is active - // this falls back to the default set (matching create). If browser is omitted or - // empty, the default set is used. A browser config that disables every category - // stops capture on update and starts no capture on create. + // interaction), screenshot and platform are off by default; set enabled=true to + // opt in. On create, provided categories layer onto the default set. On update, + // provided categories merge onto the session's current config; when no telemetry + // is active this falls back to the default set (matching create). If browser is + // omitted or empty, the default set is used. A browser config that disables every + // category stops capture on update and starts no capture on create. Browser BrowserTelemetryCategoriesConfigParam `json:"browser,omitzero"` // Where to export this session's captured telemetry. Omit to capture without // exporting. @@ -1296,12 +1296,12 @@ type ManagedAuthCreateRequestBrowserTelemetryParam struct { // Per-category capture flags. The operational categories (control, connection, // system, captcha) are captured whenever telemetry is enabled; set one to // enabled=false to opt out. The CDP categories (console, network, page, - // interaction) and screenshot are off by default; set enabled=true to opt in. On - // create, provided categories layer onto the default set. On update, provided - // categories merge onto the session's current config; when no telemetry is active - // this falls back to the default set (matching create). If browser is omitted or - // empty, the default set is used. A browser config that disables every category - // stops capture on update and starts no capture on create. + // interaction), screenshot and platform are off by default; set enabled=true to + // opt in. On create, provided categories layer onto the default set. On update, + // provided categories merge onto the session's current config; when no telemetry + // is active this falls back to the default set (matching create). If browser is + // omitted or empty, the default set is used. A browser config that disables every + // category stops capture on update and starts no capture on create. Browser BrowserTelemetryCategoriesConfigParam `json:"browser,omitzero"` // Where to export this session's captured telemetry. Omit to capture without // exporting. @@ -1606,12 +1606,12 @@ type ManagedAuthUpdateRequestBrowserTelemetryParam struct { // Per-category capture flags. The operational categories (control, connection, // system, captcha) are captured whenever telemetry is enabled; set one to // enabled=false to opt out. The CDP categories (console, network, page, - // interaction) and screenshot are off by default; set enabled=true to opt in. On - // create, provided categories layer onto the default set. On update, provided - // categories merge onto the session's current config; when no telemetry is active - // this falls back to the default set (matching create). If browser is omitted or - // empty, the default set is used. A browser config that disables every category - // stops capture on update and starts no capture on create. + // interaction), screenshot and platform are off by default; set enabled=true to + // opt in. On create, provided categories layer onto the default set. On update, + // provided categories merge onto the session's current config; when no telemetry + // is active this falls back to the default set (matching create). If browser is + // omitted or empty, the default set is used. A browser config that disables every + // category stops capture on update and starts no capture on create. Browser BrowserTelemetryCategoriesConfigParam `json:"browser,omitzero"` // Where to export this session's captured telemetry. Omit to capture without // exporting. @@ -2303,12 +2303,12 @@ type AuthConnectionLoginParamsBrowserTelemetry struct { // Per-category capture flags. The operational categories (control, connection, // system, captcha) are captured whenever telemetry is enabled; set one to // enabled=false to opt out. The CDP categories (console, network, page, - // interaction) and screenshot are off by default; set enabled=true to opt in. On - // create, provided categories layer onto the default set. On update, provided - // categories merge onto the session's current config; when no telemetry is active - // this falls back to the default set (matching create). If browser is omitted or - // empty, the default set is used. A browser config that disables every category - // stops capture on update and starts no capture on create. + // interaction), screenshot and platform are off by default; set enabled=true to + // opt in. On create, provided categories layer onto the default set. On update, + // provided categories merge onto the session's current config; when no telemetry + // is active this falls back to the default set (matching create). If browser is + // omitted or empty, the default set is used. A browser config that disables every + // category stops capture on update and starts no capture on create. Browser BrowserTelemetryCategoriesConfigParam `json:"browser,omitzero"` // Where to export this session's captured telemetry. Omit to capture without // exporting. diff --git a/authconnection_test.go b/authconnection_test.go index 361ddf3..0017685 100644 --- a/authconnection_test.go +++ b/authconnection_test.go @@ -50,7 +50,10 @@ func TestAuthConnectionNewWithOptionalParams(t *testing.T) { Console: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, - Control: kernel.BrowserTelemetryCategoryConfigParam{ + Control: kernel.BrowserTelemetryControlConfigParam{ + Cdp: kernel.BrowserTelemetryCdpControlConfigParam{ + ExcludedMethods: []kernel.BrowserCdpCommandMethod{kernel.BrowserCdpCommandMethodInputDispatchMouseEvent}, + }, Enabled: kernel.Bool(true), }, Interaction: kernel.BrowserTelemetryCategoryConfigParam{ @@ -62,6 +65,9 @@ func TestAuthConnectionNewWithOptionalParams(t *testing.T) { Page: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, + Platform: kernel.BrowserTelemetryCategoryConfigParam{ + Enabled: kernel.Bool(true), + }, Screenshot: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, @@ -92,7 +98,10 @@ func TestAuthConnectionNewWithOptionalParams(t *testing.T) { Console: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, - Control: kernel.BrowserTelemetryCategoryConfigParam{ + Control: kernel.BrowserTelemetryControlConfigParam{ + Cdp: kernel.BrowserTelemetryCdpControlConfigParam{ + ExcludedMethods: []kernel.BrowserCdpCommandMethod{kernel.BrowserCdpCommandMethodInputDispatchMouseEvent}, + }, Enabled: kernel.Bool(true), }, Interaction: kernel.BrowserTelemetryCategoryConfigParam{ @@ -104,6 +113,9 @@ func TestAuthConnectionNewWithOptionalParams(t *testing.T) { Page: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, + Platform: kernel.BrowserTelemetryCategoryConfigParam{ + Enabled: kernel.Bool(true), + }, Screenshot: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, @@ -209,7 +221,10 @@ func TestAuthConnectionUpdateWithOptionalParams(t *testing.T) { Console: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, - Control: kernel.BrowserTelemetryCategoryConfigParam{ + Control: kernel.BrowserTelemetryControlConfigParam{ + Cdp: kernel.BrowserTelemetryCdpControlConfigParam{ + ExcludedMethods: []kernel.BrowserCdpCommandMethod{kernel.BrowserCdpCommandMethodInputDispatchMouseEvent}, + }, Enabled: kernel.Bool(true), }, Interaction: kernel.BrowserTelemetryCategoryConfigParam{ @@ -221,6 +236,9 @@ func TestAuthConnectionUpdateWithOptionalParams(t *testing.T) { Page: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, + Platform: kernel.BrowserTelemetryCategoryConfigParam{ + Enabled: kernel.Bool(true), + }, Screenshot: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, @@ -251,7 +269,10 @@ func TestAuthConnectionUpdateWithOptionalParams(t *testing.T) { Console: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, - Control: kernel.BrowserTelemetryCategoryConfigParam{ + Control: kernel.BrowserTelemetryControlConfigParam{ + Cdp: kernel.BrowserTelemetryCdpControlConfigParam{ + ExcludedMethods: []kernel.BrowserCdpCommandMethod{kernel.BrowserCdpCommandMethodInputDispatchMouseEvent}, + }, Enabled: kernel.Bool(true), }, Interaction: kernel.BrowserTelemetryCategoryConfigParam{ @@ -263,6 +284,9 @@ func TestAuthConnectionUpdateWithOptionalParams(t *testing.T) { Page: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, + Platform: kernel.BrowserTelemetryCategoryConfigParam{ + Enabled: kernel.Bool(true), + }, Screenshot: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, @@ -395,7 +419,10 @@ func TestAuthConnectionLoginWithOptionalParams(t *testing.T) { Console: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, - Control: kernel.BrowserTelemetryCategoryConfigParam{ + Control: kernel.BrowserTelemetryControlConfigParam{ + Cdp: kernel.BrowserTelemetryCdpControlConfigParam{ + ExcludedMethods: []kernel.BrowserCdpCommandMethod{kernel.BrowserCdpCommandMethodInputDispatchMouseEvent}, + }, Enabled: kernel.Bool(true), }, Interaction: kernel.BrowserTelemetryCategoryConfigParam{ @@ -407,6 +434,9 @@ func TestAuthConnectionLoginWithOptionalParams(t *testing.T) { Page: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, + Platform: kernel.BrowserTelemetryCategoryConfigParam{ + Enabled: kernel.Bool(true), + }, Screenshot: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, @@ -437,7 +467,10 @@ func TestAuthConnectionLoginWithOptionalParams(t *testing.T) { Console: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, - Control: kernel.BrowserTelemetryCategoryConfigParam{ + Control: kernel.BrowserTelemetryControlConfigParam{ + Cdp: kernel.BrowserTelemetryCdpControlConfigParam{ + ExcludedMethods: []kernel.BrowserCdpCommandMethod{kernel.BrowserCdpCommandMethodInputDispatchMouseEvent}, + }, Enabled: kernel.Bool(true), }, Interaction: kernel.BrowserTelemetryCategoryConfigParam{ @@ -449,6 +482,9 @@ func TestAuthConnectionLoginWithOptionalParams(t *testing.T) { Page: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, + Platform: kernel.BrowserTelemetryCategoryConfigParam{ + Enabled: kernel.Bool(true), + }, Screenshot: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, diff --git a/browser.go b/browser.go index bb9c6ca..47813e7 100644 --- a/browser.go +++ b/browser.go @@ -1023,7 +1023,7 @@ func (r *BrowserCurlResponse) UnmarshalJSON(data []byte) error { type BrowserNewParams struct { // If true, enables GPU acceleration for the browser session. Requires Start-Up or - // Enterprise plan and headless=false. + // Enterprise plan, headless=false, and region=us-east. GPU param.Opt[bool] `json:"gpu,omitzero"` // If true, launches the browser using a headless image (no VNC/GUI). Defaults to // false. @@ -1149,12 +1149,12 @@ type BrowserNewParamsTelemetry struct { // Per-category capture flags. The operational categories (control, connection, // system, captcha) are captured whenever telemetry is enabled; set one to // enabled=false to opt out. The CDP categories (console, network, page, - // interaction) and screenshot are off by default; set enabled=true to opt in. On - // create, provided categories layer onto the default set. On update, provided - // categories merge onto the session's current config; when no telemetry is active - // this falls back to the default set (matching create). If browser is omitted or - // empty, the default set is used. A browser config that disables every category - // stops capture on update and starts no capture on create. + // interaction), screenshot and platform are off by default; set enabled=true to + // opt in. On create, provided categories layer onto the default set. On update, + // provided categories merge onto the session's current config; when no telemetry + // is active this falls back to the default set (matching create). If browser is + // omitted or empty, the default set is used. A browser config that disables every + // category stops capture on update and starts no capture on create. Browser BrowserTelemetryCategoriesConfigParam `json:"browser,omitzero"` // Where to export this session's captured telemetry. Omit to capture without // exporting. @@ -1300,12 +1300,12 @@ type BrowserUpdateParamsTelemetry struct { // Per-category capture flags. The operational categories (control, connection, // system, captcha) are captured whenever telemetry is enabled; set one to // enabled=false to opt out. The CDP categories (console, network, page, - // interaction) and screenshot are off by default; set enabled=true to opt in. On - // create, provided categories layer onto the default set. On update, provided - // categories merge onto the session's current config; when no telemetry is active - // this falls back to the default set (matching create). If browser is omitted or - // empty, the default set is used. A browser config that disables every category - // stops capture on update and starts no capture on create. + // interaction), screenshot and platform are off by default; set enabled=true to + // opt in. On create, provided categories layer onto the default set. On update, + // provided categories merge onto the session's current config; when no telemetry + // is active this falls back to the default set (matching create). If browser is + // omitted or empty, the default set is used. A browser config that disables every + // category stops capture on update and starts no capture on create. Browser BrowserTelemetryCategoriesConfigParam `json:"browser,omitzero"` // Where to export this session's captured telemetry. Omit to capture without // exporting. diff --git a/browser_test.go b/browser_test.go index 5fa2207..8130f57 100644 --- a/browser_test.go +++ b/browser_test.go @@ -75,7 +75,10 @@ func TestBrowserNewWithOptionalParams(t *testing.T) { Console: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, - Control: kernel.BrowserTelemetryCategoryConfigParam{ + Control: kernel.BrowserTelemetryControlConfigParam{ + Cdp: kernel.BrowserTelemetryCdpControlConfigParam{ + ExcludedMethods: []kernel.BrowserCdpCommandMethod{kernel.BrowserCdpCommandMethodInputDispatchMouseEvent}, + }, Enabled: kernel.Bool(true), }, Interaction: kernel.BrowserTelemetryCategoryConfigParam{ @@ -87,6 +90,9 @@ func TestBrowserNewWithOptionalParams(t *testing.T) { Page: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, + Platform: kernel.BrowserTelemetryCategoryConfigParam{ + Enabled: kernel.Bool(true), + }, Screenshot: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, @@ -195,7 +201,10 @@ func TestBrowserUpdateWithOptionalParams(t *testing.T) { Console: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, - Control: kernel.BrowserTelemetryCategoryConfigParam{ + Control: kernel.BrowserTelemetryControlConfigParam{ + Cdp: kernel.BrowserTelemetryCdpControlConfigParam{ + ExcludedMethods: []kernel.BrowserCdpCommandMethod{kernel.BrowserCdpCommandMethodInputDispatchMouseEvent}, + }, Enabled: kernel.Bool(true), }, Interaction: kernel.BrowserTelemetryCategoryConfigParam{ @@ -207,6 +216,9 @@ func TestBrowserUpdateWithOptionalParams(t *testing.T) { Page: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, + Platform: kernel.BrowserTelemetryCategoryConfigParam{ + Enabled: kernel.Bool(true), + }, Screenshot: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, diff --git a/browserpool.go b/browserpool.go index fe6b483..b851a3b 100644 --- a/browserpool.go +++ b/browserpool.go @@ -611,12 +611,12 @@ type BrowserPoolNewParamsTelemetry struct { // Per-category capture flags. The operational categories (control, connection, // system, captcha) are captured whenever telemetry is enabled; set one to // enabled=false to opt out. The CDP categories (console, network, page, - // interaction) and screenshot are off by default; set enabled=true to opt in. On - // create, provided categories layer onto the default set. On update, provided - // categories merge onto the session's current config; when no telemetry is active - // this falls back to the default set (matching create). If browser is omitted or - // empty, the default set is used. A browser config that disables every category - // stops capture on update and starts no capture on create. + // interaction), screenshot and platform are off by default; set enabled=true to + // opt in. On create, provided categories layer onto the default set. On update, + // provided categories merge onto the session's current config; when no telemetry + // is active this falls back to the default set (matching create). If browser is + // omitted or empty, the default set is used. A browser config that disables every + // category stops capture on update and starts no capture on create. Browser BrowserTelemetryCategoriesConfigParam `json:"browser,omitzero"` // Where to export this session's captured telemetry. Omit to capture without // exporting. @@ -823,12 +823,12 @@ type BrowserPoolUpdateParamsTelemetry struct { // Per-category capture flags. The operational categories (control, connection, // system, captcha) are captured whenever telemetry is enabled; set one to // enabled=false to opt out. The CDP categories (console, network, page, - // interaction) and screenshot are off by default; set enabled=true to opt in. On - // create, provided categories layer onto the default set. On update, provided - // categories merge onto the session's current config; when no telemetry is active - // this falls back to the default set (matching create). If browser is omitted or - // empty, the default set is used. A browser config that disables every category - // stops capture on update and starts no capture on create. + // interaction), screenshot and platform are off by default; set enabled=true to + // opt in. On create, provided categories layer onto the default set. On update, + // provided categories merge onto the session's current config; when no telemetry + // is active this falls back to the default set (matching create). If browser is + // omitted or empty, the default set is used. A browser config that disables every + // category stops capture on update and starts no capture on create. Browser BrowserTelemetryCategoriesConfigParam `json:"browser,omitzero"` // Where to export this session's captured telemetry. Omit to capture without // exporting. @@ -1008,12 +1008,12 @@ type BrowserPoolAcquireParamsTelemetry struct { // Per-category capture flags. The operational categories (control, connection, // system, captcha) are captured whenever telemetry is enabled; set one to // enabled=false to opt out. The CDP categories (console, network, page, - // interaction) and screenshot are off by default; set enabled=true to opt in. On - // create, provided categories layer onto the default set. On update, provided - // categories merge onto the session's current config; when no telemetry is active - // this falls back to the default set (matching create). If browser is omitted or - // empty, the default set is used. A browser config that disables every category - // stops capture on update and starts no capture on create. + // interaction), screenshot and platform are off by default; set enabled=true to + // opt in. On create, provided categories layer onto the default set. On update, + // provided categories merge onto the session's current config; when no telemetry + // is active this falls back to the default set (matching create). If browser is + // omitted or empty, the default set is used. A browser config that disables every + // category stops capture on update and starts no capture on create. Browser BrowserTelemetryCategoriesConfigParam `json:"browser,omitzero"` // Where to export this session's captured telemetry. Omit to capture without // exporting. diff --git a/browserpool_test.go b/browserpool_test.go index 2d20137..1be6e77 100644 --- a/browserpool_test.go +++ b/browserpool_test.go @@ -63,7 +63,10 @@ func TestBrowserPoolNewWithOptionalParams(t *testing.T) { Console: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, - Control: kernel.BrowserTelemetryCategoryConfigParam{ + Control: kernel.BrowserTelemetryControlConfigParam{ + Cdp: kernel.BrowserTelemetryCdpControlConfigParam{ + ExcludedMethods: []kernel.BrowserCdpCommandMethod{kernel.BrowserCdpCommandMethodInputDispatchMouseEvent}, + }, Enabled: kernel.Bool(true), }, Interaction: kernel.BrowserTelemetryCategoryConfigParam{ @@ -75,6 +78,9 @@ func TestBrowserPoolNewWithOptionalParams(t *testing.T) { Page: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, + Platform: kernel.BrowserTelemetryCategoryConfigParam{ + Enabled: kernel.Bool(true), + }, Screenshot: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, @@ -184,7 +190,10 @@ func TestBrowserPoolUpdateWithOptionalParams(t *testing.T) { Console: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, - Control: kernel.BrowserTelemetryCategoryConfigParam{ + Control: kernel.BrowserTelemetryControlConfigParam{ + Cdp: kernel.BrowserTelemetryCdpControlConfigParam{ + ExcludedMethods: []kernel.BrowserCdpCommandMethod{kernel.BrowserCdpCommandMethodInputDispatchMouseEvent}, + }, Enabled: kernel.Bool(true), }, Interaction: kernel.BrowserTelemetryCategoryConfigParam{ @@ -196,6 +205,9 @@ func TestBrowserPoolUpdateWithOptionalParams(t *testing.T) { Page: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, + Platform: kernel.BrowserTelemetryCategoryConfigParam{ + Enabled: kernel.Bool(true), + }, Screenshot: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, @@ -324,7 +336,10 @@ func TestBrowserPoolAcquireWithOptionalParams(t *testing.T) { Console: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, - Control: kernel.BrowserTelemetryCategoryConfigParam{ + Control: kernel.BrowserTelemetryControlConfigParam{ + Cdp: kernel.BrowserTelemetryCdpControlConfigParam{ + ExcludedMethods: []kernel.BrowserCdpCommandMethod{kernel.BrowserCdpCommandMethodInputDispatchMouseEvent}, + }, Enabled: kernel.Bool(true), }, Interaction: kernel.BrowserTelemetryCategoryConfigParam{ @@ -336,6 +351,9 @@ func TestBrowserPoolAcquireWithOptionalParams(t *testing.T) { Page: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, + Platform: kernel.BrowserTelemetryCategoryConfigParam{ + Enabled: kernel.Bool(true), + }, Screenshot: kernel.BrowserTelemetryCategoryConfigParam{ Enabled: kernel.Bool(true), }, diff --git a/browsertelemetry.go b/browsertelemetry.go index 55581a3..04b3567 100644 --- a/browsertelemetry.go +++ b/browsertelemetry.go @@ -105,7 +105,8 @@ func (r *BrowserTelemetryService) StreamStreaming(ctx context.Context, id string return ssestream.NewStream[BrowserTelemetryStreamResponse](ssestream.NewDecoder(raw), err) } -// An agent-driven HTTP call handled by the in-VM API server. +// An agent-driven HTTP call that drives the browser, handled by the in-VM API +// server. Calls that manage the VM instead emit platform_api_call. type BrowserAPICallEvent struct { Category constant.Control `json:"category" default:"control"` // Provenance metadata identifying which producer emitted the event. @@ -138,18 +139,24 @@ func (r *BrowserAPICallEvent) UnmarshalJSON(data []byte) error { type BrowserAPICallEventData struct { // Wall-clock duration of the handler in milliseconds. DurationMs float64 `json:"duration_ms" api:"required"` - // OpenAPI operationId of the matched route (e.g. processExec, takeScreenshot). + // Matched route's operation, named as the in-VM API names its handler (e.g. + // ProcessExec, TakeScreenshot). OperationID string `json:"operation_id" api:"required"` // Per-request identifier from the in-VM API request middleware. RequestID string `json:"request_id" api:"required"` // HTTP response status code. Status int64 `json:"status" api:"required"` + // Source submitted to the Playwright code-execution endpoint, capped at 8192 bytes + // like every other captured string. A capped value is cut on a character boundary + // and ends in `...[truncated]`. Absent for every other operation. + Code string `json:"code"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { DurationMs respjson.Field OperationID respjson.Field RequestID respjson.Field Status respjson.Field + Code respjson.Field ExtraFields map[string]respjson.Field raw string } `json:"-"` @@ -246,51 +253,2852 @@ func (r *BrowserCaptchaSolveResultEvent) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } -type BrowserCaptchaSolveResultEventData struct { - // Captcha vendor family. Provider-specific task names are normalized into this - // set; anything not covered is reported as other. - // - // Any of "hcaptcha", "recaptcha_v2", "recaptcha_v3", "turnstile", "geetest", - // "other". - CaptchaType string `json:"captcha_type" api:"required"` - // Wall-clock duration from solve start to terminal outcome. - DurationMs float64 `json:"duration_ms" api:"required"` - // Terminal outcome. success: solver returned a usable solution. failure: solver - // returned an error (see error_code). timeout: solver did not return within the - // caller's wait budget. abandoned: caller cancelled or the page navigated away - // mid-solve. +type BrowserCaptchaSolveResultEventData struct { + // Captcha vendor family. Provider-specific task names are normalized into this + // set; anything not covered is reported as other. + // + // Any of "hcaptcha", "recaptcha_v2", "recaptcha_v3", "turnstile", "geetest", + // "other". + CaptchaType string `json:"captcha_type" api:"required"` + // Wall-clock duration from solve start to terminal outcome. + DurationMs float64 `json:"duration_ms" api:"required"` + // Terminal outcome. success: solver returned a usable solution. failure: solver + // returned an error (see error_code). timeout: solver did not return within the + // caller's wait budget. abandoned: caller cancelled or the page navigated away + // mid-solve. + // + // Any of "success", "failure", "timeout", "abandoned". + Status string `json:"status" api:"required"` + // Solver-specific error code on failure (e.g. ERROR_CAPTCHA_UNSOLVABLE). Absent on + // success. + ErrorCode string `json:"error_code"` + // Solver-assigned identifier. Opaque, useful for support cross-references. + TaskID string `json:"task_id"` + // Host of the page where the captcha was solved. + WebsiteHost string `json:"website_host"` + // Path of the page where the captcha was solved. Query string excluded. + WebsitePath string `json:"website_path"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + CaptchaType respjson.Field + DurationMs respjson.Field + Status respjson.Field + ErrorCode respjson.Field + TaskID respjson.Field + WebsiteHost respjson.Field + WebsitePath respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCaptchaSolveResultEventData) RawJSON() string { return r.JSON.raw } +func (r *BrowserCaptchaSolveResultEventData) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// A browser-control command a client sent over the CDP WebSocket proxy: input +// gestures, navigation, dialog handling, file selection and screenshots. +// Configuration commands and the DOM/Runtime traffic a client library issues on +// the caller's behalf are not reported. One event per browser-control command that +// reached the browser. The command stream is not sampled, coalesced or reordered. +// An event is lost only when the method is excluded by telemetry configuration, +// when the command's arguments do not decode, or when classification cannot keep +// up. Exclusions are counted in `cdp_disconnect.telemetry_excluded`; the rest in +// `cdp_disconnect.telemetry_dropped`. +type BrowserCdpCommandEvent struct { + Category constant.Control `json:"category" default:"control"` + // Per-command payload for `cdp_command` events, discriminated by `method`. Each + // variant carries only the arguments approved for that command: values that could + // hold a secret — typed and composition text, URLs, referrers, scripts, templates, + // file paths, drag contents and autofill values — are replaced by a length, a + // count, a presence flag, an enum or a URL scheme and host. + Data BrowserCdpCommandEventDataUnion `json:"data" api:"required"` + // Provenance metadata identifying which producer emitted the event. + Source BrowserEventSource `json:"source" api:"required"` + // Event timestamp in Unix microseconds. + Ts int64 `json:"ts" api:"required"` + Type constant.CdpCommand `json:"type" default:"cdp_command"` + // True if the data field was truncated due to size limits. + Truncated bool `json:"truncated"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Category respjson.Field + Data respjson.Field + Source respjson.Field + Ts respjson.Field + Type respjson.Field + Truncated respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEvent) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEvent) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// BrowserCdpCommandEventDataUnion contains all possible properties and values from +// [BrowserCdpCommandEventDataInputDispatchMouseEvent], +// [BrowserCdpCommandEventDataInputDispatchKeyEvent], +// [BrowserCdpCommandEventDataInputInsertText], +// [BrowserCdpCommandEventDataInputImeSetComposition], +// [BrowserCdpCommandEventDataInputDispatchTouchEvent], +// [BrowserCdpCommandEventDataInputDispatchDragEvent], +// [BrowserCdpCommandEventDataInputCancelDragging], +// [BrowserCdpCommandEventDataInputEmulateTouchFromMouseEvent], +// [BrowserCdpCommandEventDataInputSynthesizePinchGesture], +// [BrowserCdpCommandEventDataInputSynthesizeScrollGesture], +// [BrowserCdpCommandEventDataInputSynthesizeTapGesture], +// [BrowserCdpCommandEventDataDomSetFileInputFiles], +// [BrowserCdpCommandEventDataDomFocus], +// [BrowserCdpCommandEventDataDomScrollIntoViewIfNeeded], +// [BrowserCdpCommandEventDataPageBringToFront], +// [BrowserCdpCommandEventDataPageCaptureScreenshot], +// [BrowserCdpCommandEventDataPageCaptureSnapshot], +// [BrowserCdpCommandEventDataPageHandleJavaScriptDialog], +// [BrowserCdpCommandEventDataPageNavigate], +// [BrowserCdpCommandEventDataPageNavigateToHistoryEntry], +// [BrowserCdpCommandEventDataPageReload], +// [BrowserCdpCommandEventDataPagePrintToPdf], +// [BrowserCdpCommandEventDataPageStartScreencast], +// [BrowserCdpCommandEventDataPageStopScreencast], +// [BrowserCdpCommandEventDataPageStopLoading], +// [BrowserCdpCommandEventDataPageClose], +// [BrowserCdpCommandEventDataPageSetWebLifecycleState], +// [BrowserCdpCommandEventDataTargetActivateTarget], +// [BrowserCdpCommandEventDataTargetCloseTarget], +// [BrowserCdpCommandEventDataTargetCreateTarget], +// [BrowserCdpCommandEventDataTargetCreateBrowserContext], +// [BrowserCdpCommandEventDataTargetDisposeBrowserContext], +// [BrowserCdpCommandEventDataTargetOpenDevTools], +// [BrowserCdpCommandEventDataBrowserCancelDownload], +// [BrowserCdpCommandEventDataBrowserClose], +// [BrowserCdpCommandEventDataBrowserSetWindowBounds], +// [BrowserCdpCommandEventDataBrowserSetContentsSize], +// [BrowserCdpCommandEventDataAutofillTrigger]. +// +// Use the [BrowserCdpCommandEventDataUnion.AsAny] method to switch on the variant. +// +// Use the methods beginning with 'As' to cast the union to one of its variants. +type BrowserCdpCommandEventDataUnion struct { + EventType string `json:"event_type"` + // Any of "Input.dispatchMouseEvent", "Input.dispatchKeyEvent", "Input.insertText", + // "Input.imeSetComposition", "Input.dispatchTouchEvent", + // "Input.dispatchDragEvent", "Input.cancelDragging", + // "Input.emulateTouchFromMouseEvent", "Input.synthesizePinchGesture", + // "Input.synthesizeScrollGesture", "Input.synthesizeTapGesture", + // "DOM.setFileInputFiles", "DOM.focus", "DOM.scrollIntoViewIfNeeded", + // "Page.bringToFront", "Page.captureScreenshot", "Page.captureSnapshot", + // "Page.handleJavaScriptDialog", "Page.navigate", "Page.navigateToHistoryEntry", + // "Page.reload", "Page.printToPDF", "Page.startScreencast", "Page.stopScreencast", + // "Page.stopLoading", "Page.close", "Page.setWebLifecycleState", + // "Target.activateTarget", "Target.closeTarget", "Target.createTarget", + // "Target.createBrowserContext", "Target.disposeBrowserContext", + // "Target.openDevTools", "Browser.cancelDownload", "Browser.close", + // "Browser.setWindowBounds", "Browser.setContentsSize", "Autofill.trigger". + Method string `json:"method"` + Button string `json:"button"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchMouseEvent]. + Buttons int64 `json:"buttons"` + ClickCount int64 `json:"click_count"` + CommandID int64 `json:"command_id"` + ConnectionID string `json:"connection_id"` + DeltaX float64 `json:"delta_x"` + DeltaY float64 `json:"delta_y"` + Force float64 `json:"force"` + Modifiers int64 `json:"modifiers"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchMouseEvent]. + PointerType string `json:"pointer_type"` + SessionID string `json:"session_id"` + TangentialPressure float64 `json:"tangential_pressure"` + TiltX float64 `json:"tilt_x"` + TiltY float64 `json:"tilt_y"` + Twist int64 `json:"twist"` + X float64 `json:"x"` + Y float64 `json:"y"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchKeyEvent]. + AutoRepeat bool `json:"auto_repeat"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchKeyEvent]. + CommandCount int64 `json:"command_count"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchKeyEvent]. + IsKeypad bool `json:"is_keypad"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchKeyEvent]. + IsSystemKey bool `json:"is_system_key"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchKeyEvent]. + Location int64 `json:"location"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchKeyEvent]. + NamedKey string `json:"named_key"` + TextLength int64 `json:"text_length"` + // This field is from variant [BrowserCdpCommandEventDataInputImeSetComposition]. + ReplacementEnd int64 `json:"replacement_end"` + // This field is from variant [BrowserCdpCommandEventDataInputImeSetComposition]. + ReplacementStart int64 `json:"replacement_start"` + // This field is from variant [BrowserCdpCommandEventDataInputImeSetComposition]. + SelectionEnd int64 `json:"selection_end"` + // This field is from variant [BrowserCdpCommandEventDataInputImeSetComposition]. + SelectionStart int64 `json:"selection_start"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchTouchEvent]. + TouchPointCount int64 `json:"touch_point_count"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchTouchEvent]. + RadiusX float64 `json:"radius_x"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchTouchEvent]. + RadiusY float64 `json:"radius_y"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchTouchEvent]. + RotationAngle float64 `json:"rotation_angle"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchDragEvent]. + DragFileCount int64 `json:"drag_file_count"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchDragEvent]. + DragItemCount int64 `json:"drag_item_count"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchDragEvent]. + DragMimeCategories []string `json:"drag_mime_categories"` + // This field is from variant [BrowserCdpCommandEventDataInputDispatchDragEvent]. + DragOperationsMask int64 `json:"drag_operations_mask"` + GestureSourceType string `json:"gesture_source_type"` + // This field is from variant + // [BrowserCdpCommandEventDataInputSynthesizePinchGesture]. + RelativeSpeed int64 `json:"relative_speed"` + // This field is from variant + // [BrowserCdpCommandEventDataInputSynthesizePinchGesture]. + ScaleFactor float64 `json:"scale_factor"` + // This field is from variant + // [BrowserCdpCommandEventDataInputSynthesizeScrollGesture]. + PreventFling bool `json:"prevent_fling"` + // This field is from variant + // [BrowserCdpCommandEventDataInputSynthesizeScrollGesture]. + RepeatCount int64 `json:"repeat_count"` + // This field is from variant + // [BrowserCdpCommandEventDataInputSynthesizeScrollGesture]. + RepeatDelayMs int64 `json:"repeat_delay_ms"` + // This field is from variant + // [BrowserCdpCommandEventDataInputSynthesizeScrollGesture]. + Speed int64 `json:"speed"` + // This field is from variant + // [BrowserCdpCommandEventDataInputSynthesizeScrollGesture]. + XDistance float64 `json:"x_distance"` + // This field is from variant + // [BrowserCdpCommandEventDataInputSynthesizeScrollGesture]. + XOverscroll float64 `json:"x_overscroll"` + // This field is from variant + // [BrowserCdpCommandEventDataInputSynthesizeScrollGesture]. + YDistance float64 `json:"y_distance"` + // This field is from variant + // [BrowserCdpCommandEventDataInputSynthesizeScrollGesture]. + YOverscroll float64 `json:"y_overscroll"` + // This field is from variant + // [BrowserCdpCommandEventDataInputSynthesizeTapGesture]. + Duration int64 `json:"duration"` + // This field is from variant + // [BrowserCdpCommandEventDataInputSynthesizeTapGesture]. + TapCount int64 `json:"tap_count"` + // This field is from variant [BrowserCdpCommandEventDataDomSetFileInputFiles]. + FileCount int64 `json:"file_count"` + BackendNodeID int64 `json:"backend_node_id"` + NodeID int64 `json:"node_id"` + ObjectID string `json:"object_id"` + // This field is from variant + // [BrowserCdpCommandEventDataDomScrollIntoViewIfNeeded]. + RectHeight float64 `json:"rect_height"` + // This field is from variant + // [BrowserCdpCommandEventDataDomScrollIntoViewIfNeeded]. + RectWidth float64 `json:"rect_width"` + // This field is from variant + // [BrowserCdpCommandEventDataDomScrollIntoViewIfNeeded]. + RectX float64 `json:"rect_x"` + // This field is from variant + // [BrowserCdpCommandEventDataDomScrollIntoViewIfNeeded]. + RectY float64 `json:"rect_y"` + // This field is from variant [BrowserCdpCommandEventDataPageCaptureScreenshot]. + CaptureBeyondViewport bool `json:"capture_beyond_viewport"` + // This field is from variant [BrowserCdpCommandEventDataPageCaptureScreenshot]. + ClipHeight float64 `json:"clip_height"` + // This field is from variant [BrowserCdpCommandEventDataPageCaptureScreenshot]. + ClipScale float64 `json:"clip_scale"` + // This field is from variant [BrowserCdpCommandEventDataPageCaptureScreenshot]. + ClipWidth float64 `json:"clip_width"` + // This field is from variant [BrowserCdpCommandEventDataPageCaptureScreenshot]. + ClipX float64 `json:"clip_x"` + // This field is from variant [BrowserCdpCommandEventDataPageCaptureScreenshot]. + ClipY float64 `json:"clip_y"` + Format string `json:"format"` + // This field is from variant [BrowserCdpCommandEventDataPageCaptureScreenshot]. + FromSurface bool `json:"from_surface"` + // This field is from variant [BrowserCdpCommandEventDataPageCaptureScreenshot]. + OptimizeForSpeed bool `json:"optimize_for_speed"` + Quality int64 `json:"quality"` + // This field is from variant + // [BrowserCdpCommandEventDataPageHandleJavaScriptDialog]. + Accept bool `json:"accept"` + // This field is from variant + // [BrowserCdpCommandEventDataPageHandleJavaScriptDialog]. + PromptTextLength int64 `json:"prompt_text_length"` + FrameID string `json:"frame_id"` + // This field is from variant [BrowserCdpCommandEventDataPageNavigate]. + ReferrerPolicy string `json:"referrer_policy"` + // This field is from variant [BrowserCdpCommandEventDataPageNavigate]. + ReferrerPresent bool `json:"referrer_present"` + // This field is from variant [BrowserCdpCommandEventDataPageNavigate]. + TransitionType string `json:"transition_type"` + URLScheme string `json:"url_scheme"` + // This field is from variant + // [BrowserCdpCommandEventDataPageNavigateToHistoryEntry]. + EntryID int64 `json:"entry_id"` + // This field is from variant [BrowserCdpCommandEventDataPageReload]. + IgnoreCache bool `json:"ignore_cache"` + // This field is from variant [BrowserCdpCommandEventDataPageReload]. + LoaderID string `json:"loader_id"` + // This field is from variant [BrowserCdpCommandEventDataPageReload]. + ScriptLength int64 `json:"script_length"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + DisplayHeaderFooter bool `json:"display_header_footer"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + FooterTemplatePresent bool `json:"footer_template_present"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + GenerateDocumentOutline bool `json:"generate_document_outline"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + GenerateTaggedPdf bool `json:"generate_tagged_pdf"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + HeaderTemplatePresent bool `json:"header_template_present"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + Landscape bool `json:"landscape"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + MarginBottom float64 `json:"margin_bottom"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + MarginLeft float64 `json:"margin_left"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + MarginRight float64 `json:"margin_right"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + MarginTop float64 `json:"margin_top"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + PageRangesPresent bool `json:"page_ranges_present"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + PaperHeight float64 `json:"paper_height"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + PaperWidth float64 `json:"paper_width"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + PreferCssPageSize bool `json:"prefer_css_page_size"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + PrintBackground bool `json:"print_background"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + Scale float64 `json:"scale"` + // This field is from variant [BrowserCdpCommandEventDataPagePrintToPdf]. + TransferMode string `json:"transfer_mode"` + // This field is from variant [BrowserCdpCommandEventDataPageStartScreencast]. + EveryNthFrame int64 `json:"every_nth_frame"` + // This field is from variant [BrowserCdpCommandEventDataPageStartScreencast]. + MaxHeight int64 `json:"max_height"` + // This field is from variant [BrowserCdpCommandEventDataPageStartScreencast]. + MaxWidth int64 `json:"max_width"` + // This field is from variant [BrowserCdpCommandEventDataPageSetWebLifecycleState]. + State string `json:"state"` + TargetID string `json:"target_id"` + // This field is from variant [BrowserCdpCommandEventDataTargetCreateTarget]. + Background bool `json:"background"` + BrowserContextID string `json:"browser_context_id"` + // This field is from variant [BrowserCdpCommandEventDataTargetCreateTarget]. + EnableBeginFrameControl bool `json:"enable_begin_frame_control"` + // This field is from variant [BrowserCdpCommandEventDataTargetCreateTarget]. + Focus bool `json:"focus"` + // This field is from variant [BrowserCdpCommandEventDataTargetCreateTarget]. + ForTab bool `json:"for_tab"` + Height int64 `json:"height"` + // This field is from variant [BrowserCdpCommandEventDataTargetCreateTarget]. + Hidden bool `json:"hidden"` + Left int64 `json:"left"` + // This field is from variant [BrowserCdpCommandEventDataTargetCreateTarget]. + NewWindow bool `json:"new_window"` + Top int64 `json:"top"` + Width int64 `json:"width"` + WindowState string `json:"window_state"` + // This field is from variant + // [BrowserCdpCommandEventDataTargetCreateBrowserContext]. + DisposeOnDetach bool `json:"dispose_on_detach"` + // This field is from variant + // [BrowserCdpCommandEventDataTargetCreateBrowserContext]. + ProxyBypassListPresent bool `json:"proxy_bypass_list_present"` + // This field is from variant + // [BrowserCdpCommandEventDataTargetCreateBrowserContext]. + ProxyServerPresent bool `json:"proxy_server_present"` + // This field is from variant + // [BrowserCdpCommandEventDataTargetCreateBrowserContext]. + UniversalNetworkAccessOriginCount int64 `json:"universal_network_access_origin_count"` + // This field is from variant [BrowserCdpCommandEventDataTargetOpenDevTools]. + PanelID string `json:"panel_id"` + // This field is from variant [BrowserCdpCommandEventDataBrowserCancelDownload]. + DownloadGuid string `json:"download_guid"` + WindowID int64 `json:"window_id"` + // This field is from variant [BrowserCdpCommandEventDataAutofillTrigger]. + FieldID int64 `json:"field_id"` + // This field is from variant [BrowserCdpCommandEventDataAutofillTrigger]. + AddressFieldCount int64 `json:"address_field_count"` + // This field is from variant [BrowserCdpCommandEventDataAutofillTrigger]. + Mode string `json:"mode"` + JSON struct { + EventType respjson.Field + Method respjson.Field + Button respjson.Field + Buttons respjson.Field + ClickCount respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + DeltaX respjson.Field + DeltaY respjson.Field + Force respjson.Field + Modifiers respjson.Field + PointerType respjson.Field + SessionID respjson.Field + TangentialPressure respjson.Field + TiltX respjson.Field + TiltY respjson.Field + Twist respjson.Field + X respjson.Field + Y respjson.Field + AutoRepeat respjson.Field + CommandCount respjson.Field + IsKeypad respjson.Field + IsSystemKey respjson.Field + Location respjson.Field + NamedKey respjson.Field + TextLength respjson.Field + ReplacementEnd respjson.Field + ReplacementStart respjson.Field + SelectionEnd respjson.Field + SelectionStart respjson.Field + TouchPointCount respjson.Field + RadiusX respjson.Field + RadiusY respjson.Field + RotationAngle respjson.Field + DragFileCount respjson.Field + DragItemCount respjson.Field + DragMimeCategories respjson.Field + DragOperationsMask respjson.Field + GestureSourceType respjson.Field + RelativeSpeed respjson.Field + ScaleFactor respjson.Field + PreventFling respjson.Field + RepeatCount respjson.Field + RepeatDelayMs respjson.Field + Speed respjson.Field + XDistance respjson.Field + XOverscroll respjson.Field + YDistance respjson.Field + YOverscroll respjson.Field + Duration respjson.Field + TapCount respjson.Field + FileCount respjson.Field + BackendNodeID respjson.Field + NodeID respjson.Field + ObjectID respjson.Field + RectHeight respjson.Field + RectWidth respjson.Field + RectX respjson.Field + RectY respjson.Field + CaptureBeyondViewport respjson.Field + ClipHeight respjson.Field + ClipScale respjson.Field + ClipWidth respjson.Field + ClipX respjson.Field + ClipY respjson.Field + Format respjson.Field + FromSurface respjson.Field + OptimizeForSpeed respjson.Field + Quality respjson.Field + Accept respjson.Field + PromptTextLength respjson.Field + FrameID respjson.Field + ReferrerPolicy respjson.Field + ReferrerPresent respjson.Field + TransitionType respjson.Field + URLScheme respjson.Field + EntryID respjson.Field + IgnoreCache respjson.Field + LoaderID respjson.Field + ScriptLength respjson.Field + DisplayHeaderFooter respjson.Field + FooterTemplatePresent respjson.Field + GenerateDocumentOutline respjson.Field + GenerateTaggedPdf respjson.Field + HeaderTemplatePresent respjson.Field + Landscape respjson.Field + MarginBottom respjson.Field + MarginLeft respjson.Field + MarginRight respjson.Field + MarginTop respjson.Field + PageRangesPresent respjson.Field + PaperHeight respjson.Field + PaperWidth respjson.Field + PreferCssPageSize respjson.Field + PrintBackground respjson.Field + Scale respjson.Field + TransferMode respjson.Field + EveryNthFrame respjson.Field + MaxHeight respjson.Field + MaxWidth respjson.Field + State respjson.Field + TargetID respjson.Field + Background respjson.Field + BrowserContextID respjson.Field + EnableBeginFrameControl respjson.Field + Focus respjson.Field + ForTab respjson.Field + Height respjson.Field + Hidden respjson.Field + Left respjson.Field + NewWindow respjson.Field + Top respjson.Field + Width respjson.Field + WindowState respjson.Field + DisposeOnDetach respjson.Field + ProxyBypassListPresent respjson.Field + ProxyServerPresent respjson.Field + UniversalNetworkAccessOriginCount respjson.Field + PanelID respjson.Field + DownloadGuid respjson.Field + WindowID respjson.Field + FieldID respjson.Field + AddressFieldCount respjson.Field + Mode respjson.Field + raw string + } `json:"-"` +} + +// anyBrowserCdpCommandEventData is implemented by each variant of +// [BrowserCdpCommandEventDataUnion] to add type safety for the return type of +// [BrowserCdpCommandEventDataUnion.AsAny] +type anyBrowserCdpCommandEventData interface { + implBrowserCdpCommandEventDataUnion() +} + +func (BrowserCdpCommandEventDataInputDispatchMouseEvent) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataInputDispatchKeyEvent) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataInputInsertText) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataInputImeSetComposition) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataInputDispatchTouchEvent) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataInputDispatchDragEvent) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataInputCancelDragging) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataInputEmulateTouchFromMouseEvent) implBrowserCdpCommandEventDataUnion() { +} +func (BrowserCdpCommandEventDataInputSynthesizePinchGesture) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataInputSynthesizeScrollGesture) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataInputSynthesizeTapGesture) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataDomSetFileInputFiles) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataDomFocus) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataDomScrollIntoViewIfNeeded) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataPageBringToFront) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataPageCaptureScreenshot) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataPageCaptureSnapshot) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataPageHandleJavaScriptDialog) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataPageNavigate) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataPageNavigateToHistoryEntry) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataPageReload) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataPagePrintToPdf) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataPageStartScreencast) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataPageStopScreencast) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataPageStopLoading) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataPageClose) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataPageSetWebLifecycleState) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataTargetActivateTarget) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataTargetCloseTarget) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataTargetCreateTarget) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataTargetCreateBrowserContext) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataTargetDisposeBrowserContext) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataTargetOpenDevTools) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataBrowserCancelDownload) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataBrowserClose) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataBrowserSetWindowBounds) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataBrowserSetContentsSize) implBrowserCdpCommandEventDataUnion() {} +func (BrowserCdpCommandEventDataAutofillTrigger) implBrowserCdpCommandEventDataUnion() {} + +// Use the following switch statement to find the correct variant +// +// switch variant := BrowserCdpCommandEventDataUnion.AsAny().(type) { +// case kernel.BrowserCdpCommandEventDataInputDispatchMouseEvent: +// case kernel.BrowserCdpCommandEventDataInputDispatchKeyEvent: +// case kernel.BrowserCdpCommandEventDataInputInsertText: +// case kernel.BrowserCdpCommandEventDataInputImeSetComposition: +// case kernel.BrowserCdpCommandEventDataInputDispatchTouchEvent: +// case kernel.BrowserCdpCommandEventDataInputDispatchDragEvent: +// case kernel.BrowserCdpCommandEventDataInputCancelDragging: +// case kernel.BrowserCdpCommandEventDataInputEmulateTouchFromMouseEvent: +// case kernel.BrowserCdpCommandEventDataInputSynthesizePinchGesture: +// case kernel.BrowserCdpCommandEventDataInputSynthesizeScrollGesture: +// case kernel.BrowserCdpCommandEventDataInputSynthesizeTapGesture: +// case kernel.BrowserCdpCommandEventDataDomSetFileInputFiles: +// case kernel.BrowserCdpCommandEventDataDomFocus: +// case kernel.BrowserCdpCommandEventDataDomScrollIntoViewIfNeeded: +// case kernel.BrowserCdpCommandEventDataPageBringToFront: +// case kernel.BrowserCdpCommandEventDataPageCaptureScreenshot: +// case kernel.BrowserCdpCommandEventDataPageCaptureSnapshot: +// case kernel.BrowserCdpCommandEventDataPageHandleJavaScriptDialog: +// case kernel.BrowserCdpCommandEventDataPageNavigate: +// case kernel.BrowserCdpCommandEventDataPageNavigateToHistoryEntry: +// case kernel.BrowserCdpCommandEventDataPageReload: +// case kernel.BrowserCdpCommandEventDataPagePrintToPdf: +// case kernel.BrowserCdpCommandEventDataPageStartScreencast: +// case kernel.BrowserCdpCommandEventDataPageStopScreencast: +// case kernel.BrowserCdpCommandEventDataPageStopLoading: +// case kernel.BrowserCdpCommandEventDataPageClose: +// case kernel.BrowserCdpCommandEventDataPageSetWebLifecycleState: +// case kernel.BrowserCdpCommandEventDataTargetActivateTarget: +// case kernel.BrowserCdpCommandEventDataTargetCloseTarget: +// case kernel.BrowserCdpCommandEventDataTargetCreateTarget: +// case kernel.BrowserCdpCommandEventDataTargetCreateBrowserContext: +// case kernel.BrowserCdpCommandEventDataTargetDisposeBrowserContext: +// case kernel.BrowserCdpCommandEventDataTargetOpenDevTools: +// case kernel.BrowserCdpCommandEventDataBrowserCancelDownload: +// case kernel.BrowserCdpCommandEventDataBrowserClose: +// case kernel.BrowserCdpCommandEventDataBrowserSetWindowBounds: +// case kernel.BrowserCdpCommandEventDataBrowserSetContentsSize: +// case kernel.BrowserCdpCommandEventDataAutofillTrigger: +// default: +// fmt.Errorf("no variant present") +// } +func (u BrowserCdpCommandEventDataUnion) AsAny() anyBrowserCdpCommandEventData { + switch u.Method { + case "Input.dispatchMouseEvent": + return u.AsInputDispatchMouseEvent() + case "Input.dispatchKeyEvent": + return u.AsInputDispatchKeyEvent() + case "Input.insertText": + return u.AsInputInsertText() + case "Input.imeSetComposition": + return u.AsInputImeSetComposition() + case "Input.dispatchTouchEvent": + return u.AsInputDispatchTouchEvent() + case "Input.dispatchDragEvent": + return u.AsInputDispatchDragEvent() + case "Input.cancelDragging": + return u.AsInputCancelDragging() + case "Input.emulateTouchFromMouseEvent": + return u.AsInputEmulateTouchFromMouseEvent() + case "Input.synthesizePinchGesture": + return u.AsInputSynthesizePinchGesture() + case "Input.synthesizeScrollGesture": + return u.AsInputSynthesizeScrollGesture() + case "Input.synthesizeTapGesture": + return u.AsInputSynthesizeTapGesture() + case "DOM.setFileInputFiles": + return u.AsDomSetFileInputFiles() + case "DOM.focus": + return u.AsDomFocus() + case "DOM.scrollIntoViewIfNeeded": + return u.AsDomScrollIntoViewIfNeeded() + case "Page.bringToFront": + return u.AsPageBringToFront() + case "Page.captureScreenshot": + return u.AsPageCaptureScreenshot() + case "Page.captureSnapshot": + return u.AsPageCaptureSnapshot() + case "Page.handleJavaScriptDialog": + return u.AsPageHandleJavaScriptDialog() + case "Page.navigate": + return u.AsPageNavigate() + case "Page.navigateToHistoryEntry": + return u.AsPageNavigateToHistoryEntry() + case "Page.reload": + return u.AsPageReload() + case "Page.printToPDF": + return u.AsPagePrintToPdf() + case "Page.startScreencast": + return u.AsPageStartScreencast() + case "Page.stopScreencast": + return u.AsPageStopScreencast() + case "Page.stopLoading": + return u.AsPageStopLoading() + case "Page.close": + return u.AsPageClose() + case "Page.setWebLifecycleState": + return u.AsPageSetWebLifecycleState() + case "Target.activateTarget": + return u.AsTargetActivateTarget() + case "Target.closeTarget": + return u.AsTargetCloseTarget() + case "Target.createTarget": + return u.AsTargetCreateTarget() + case "Target.createBrowserContext": + return u.AsTargetCreateBrowserContext() + case "Target.disposeBrowserContext": + return u.AsTargetDisposeBrowserContext() + case "Target.openDevTools": + return u.AsTargetOpenDevTools() + case "Browser.cancelDownload": + return u.AsBrowserCancelDownload() + case "Browser.close": + return u.AsBrowserClose() + case "Browser.setWindowBounds": + return u.AsBrowserSetWindowBounds() + case "Browser.setContentsSize": + return u.AsBrowserSetContentsSize() + case "Autofill.trigger": + return u.AsAutofillTrigger() + } + return nil +} + +func (u BrowserCdpCommandEventDataUnion) AsInputDispatchMouseEvent() (v BrowserCdpCommandEventDataInputDispatchMouseEvent) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsInputDispatchKeyEvent() (v BrowserCdpCommandEventDataInputDispatchKeyEvent) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsInputInsertText() (v BrowserCdpCommandEventDataInputInsertText) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsInputImeSetComposition() (v BrowserCdpCommandEventDataInputImeSetComposition) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsInputDispatchTouchEvent() (v BrowserCdpCommandEventDataInputDispatchTouchEvent) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsInputDispatchDragEvent() (v BrowserCdpCommandEventDataInputDispatchDragEvent) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsInputCancelDragging() (v BrowserCdpCommandEventDataInputCancelDragging) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsInputEmulateTouchFromMouseEvent() (v BrowserCdpCommandEventDataInputEmulateTouchFromMouseEvent) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsInputSynthesizePinchGesture() (v BrowserCdpCommandEventDataInputSynthesizePinchGesture) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsInputSynthesizeScrollGesture() (v BrowserCdpCommandEventDataInputSynthesizeScrollGesture) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsInputSynthesizeTapGesture() (v BrowserCdpCommandEventDataInputSynthesizeTapGesture) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsDomSetFileInputFiles() (v BrowserCdpCommandEventDataDomSetFileInputFiles) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsDomFocus() (v BrowserCdpCommandEventDataDomFocus) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsDomScrollIntoViewIfNeeded() (v BrowserCdpCommandEventDataDomScrollIntoViewIfNeeded) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsPageBringToFront() (v BrowserCdpCommandEventDataPageBringToFront) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsPageCaptureScreenshot() (v BrowserCdpCommandEventDataPageCaptureScreenshot) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsPageCaptureSnapshot() (v BrowserCdpCommandEventDataPageCaptureSnapshot) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsPageHandleJavaScriptDialog() (v BrowserCdpCommandEventDataPageHandleJavaScriptDialog) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsPageNavigate() (v BrowserCdpCommandEventDataPageNavigate) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsPageNavigateToHistoryEntry() (v BrowserCdpCommandEventDataPageNavigateToHistoryEntry) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsPageReload() (v BrowserCdpCommandEventDataPageReload) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsPagePrintToPdf() (v BrowserCdpCommandEventDataPagePrintToPdf) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsPageStartScreencast() (v BrowserCdpCommandEventDataPageStartScreencast) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsPageStopScreencast() (v BrowserCdpCommandEventDataPageStopScreencast) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsPageStopLoading() (v BrowserCdpCommandEventDataPageStopLoading) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsPageClose() (v BrowserCdpCommandEventDataPageClose) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsPageSetWebLifecycleState() (v BrowserCdpCommandEventDataPageSetWebLifecycleState) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsTargetActivateTarget() (v BrowserCdpCommandEventDataTargetActivateTarget) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsTargetCloseTarget() (v BrowserCdpCommandEventDataTargetCloseTarget) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsTargetCreateTarget() (v BrowserCdpCommandEventDataTargetCreateTarget) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsTargetCreateBrowserContext() (v BrowserCdpCommandEventDataTargetCreateBrowserContext) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsTargetDisposeBrowserContext() (v BrowserCdpCommandEventDataTargetDisposeBrowserContext) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsTargetOpenDevTools() (v BrowserCdpCommandEventDataTargetOpenDevTools) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsBrowserCancelDownload() (v BrowserCdpCommandEventDataBrowserCancelDownload) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsBrowserClose() (v BrowserCdpCommandEventDataBrowserClose) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsBrowserSetWindowBounds() (v BrowserCdpCommandEventDataBrowserSetWindowBounds) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsBrowserSetContentsSize() (v BrowserCdpCommandEventDataBrowserSetContentsSize) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserCdpCommandEventDataUnion) AsAutofillTrigger() (v BrowserCdpCommandEventDataAutofillTrigger) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +// Returns the unmodified JSON received from the API +func (u BrowserCdpCommandEventDataUnion) RawJSON() string { return u.JSON.raw } + +func (r *BrowserCdpCommandEventDataUnion) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Input.dispatchMouseEvent` arguments. Canonical input: +// `Input.dispatchMouseEvent` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataInputDispatchMouseEvent struct { + // Mouse event phase: `mousePressed`, `mouseReleased`, `mouseMoved` or + // `mouseWheel`. A value the protocol does not define is reported as `other`. + // + // Any of "mousePressed", "mouseReleased", "mouseMoved", "mouseWheel", "other". + EventType string `json:"event_type" api:"required"` + Method constant.InputDispatchMouseEvent `json:"method" default:"Input.dispatchMouseEvent"` + // Button named by the command (`none`, `left`, `middle`, `right`, `back`, + // `forward`). A value the protocol does not define is reported as `other`. + // + // Any of "none", "left", "middle", "right", "back", "forward", "other". + Button string `json:"button"` + // Bit field of buttons held down. Non-zero on a `mouseMoved` means the move is a + // drag path. + Buttons int64 `json:"buttons"` + // Number of times the button was clicked (2 is a double click). + ClickCount int64 `json:"click_count"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Horizontal scroll delta, for `mouseWheel`. + DeltaX float64 `json:"delta_x"` + // Vertical scroll delta, for `mouseWheel`. + DeltaY float64 `json:"delta_y"` + // Normalized pressure, 0 to 1. + Force float64 `json:"force"` + // Bit field of held modifier keys (1=Alt, 2=Ctrl, 4=Meta, 8=Shift). + Modifiers int64 `json:"modifiers"` + // Pointer that generated the event (`mouse` or `pen`). A value the protocol does + // not define is reported as `other`. + // + // Any of "mouse", "pen", "other". + PointerType string `json:"pointer_type"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // Normalized tangential pressure, -1 to 1. + TangentialPressure float64 `json:"tangential_pressure"` + // Pen tilt from the Y-Z plane, in degrees. + TiltX float64 `json:"tilt_x"` + // Pen tilt from the X-Z plane, in degrees. + TiltY float64 `json:"tilt_y"` + // Pen clockwise rotation, in degrees. + Twist int64 `json:"twist"` + // Viewport x coordinate in CSS pixels. + X float64 `json:"x"` + // Viewport y coordinate in CSS pixels. + Y float64 `json:"y"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + EventType respjson.Field + Method respjson.Field + Button respjson.Field + Buttons respjson.Field + ClickCount respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + DeltaX respjson.Field + DeltaY respjson.Field + Force respjson.Field + Modifiers respjson.Field + PointerType respjson.Field + SessionID respjson.Field + TangentialPressure respjson.Field + TiltX respjson.Field + TiltY respjson.Field + Twist respjson.Field + X respjson.Field + Y respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataInputDispatchMouseEvent) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataInputDispatchMouseEvent) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Input.dispatchKeyEvent` arguments. Canonical input: +// `Input.dispatchKeyEvent` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataInputDispatchKeyEvent struct { + // Key event phase: `keyDown`, `keyUp`, `rawKeyDown` or `char`. A value the + // protocol does not define is reported as `other`. + // + // Any of "keyDown", "keyUp", "rawKeyDown", "char", "other". + EventType string `json:"event_type" api:"required"` + Method constant.InputDispatchKeyEvent `json:"method" default:"Input.dispatchKeyEvent"` + // Whether the event was generated by key repeat. + AutoRepeat bool `json:"auto_repeat"` + // Number of editing commands (e.g. `selectAll`) carried by the event. + CommandCount int64 `json:"command_count"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Whether the key is on the numeric keypad. + IsKeypad bool `json:"is_keypad"` + // Whether the event is a system key event. + IsSystemKey bool `json:"is_system_key"` + // Keyboard location (1=left, 2=right, 3=numpad). + Location int64 `json:"location"` + // Bit field of held modifier keys (1=Alt, 2=Ctrl, 4=Meta, 8=Shift). + Modifiers int64 `json:"modifiers"` + // Key that commands the page rather than typing into it (e.g. `Enter`, `Tab`, + // `ArrowDown`, `F5`). Keys that produce a character are never captured; those are + // counted by `text_length`. + NamedKey string `json:"named_key"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // Number of characters the command submitted. The text itself is never captured. + TextLength int64 `json:"text_length"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + EventType respjson.Field + Method respjson.Field + AutoRepeat respjson.Field + CommandCount respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + IsKeypad respjson.Field + IsSystemKey respjson.Field + Location respjson.Field + Modifiers respjson.Field + NamedKey respjson.Field + SessionID respjson.Field + TextLength respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataInputDispatchKeyEvent) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataInputDispatchKeyEvent) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Input.insertText` arguments. Canonical input: `Input.insertText` in +// devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataInputInsertText struct { + Method constant.InputInsertText `json:"method" default:"Input.insertText"` + // Number of characters inserted. The text itself is never captured. + TextLength int64 `json:"text_length" api:"required"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + TextLength respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataInputInsertText) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataInputInsertText) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Input.imeSetComposition` arguments. Canonical input: +// `Input.imeSetComposition` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataInputImeSetComposition struct { + Method constant.InputImeSetComposition `json:"method" default:"Input.imeSetComposition"` + // Number of characters in the composition. The text itself is never captured. + TextLength int64 `json:"text_length" api:"required"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Replacement range end offset. + ReplacementEnd int64 `json:"replacement_end"` + // Replacement range start offset. + ReplacementStart int64 `json:"replacement_start"` + // Selection end offset within the composition. + SelectionEnd int64 `json:"selection_end"` + // Selection start offset within the composition. + SelectionStart int64 `json:"selection_start"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + TextLength respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + ReplacementEnd respjson.Field + ReplacementStart respjson.Field + SelectionEnd respjson.Field + SelectionStart respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataInputImeSetComposition) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataInputImeSetComposition) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Input.dispatchTouchEvent` arguments. Canonical input: +// `Input.dispatchTouchEvent` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataInputDispatchTouchEvent struct { + // Touch event phase: `touchStart`, `touchEnd`, `touchMove` or `touchCancel`. A + // value the protocol does not define is reported as `other`. + // + // Any of "touchStart", "touchEnd", "touchMove", "touchCancel", "other". + EventType string `json:"event_type" api:"required"` + Method constant.InputDispatchTouchEvent `json:"method" default:"Input.dispatchTouchEvent"` + // Number of active touch points the command carried. + TouchPointCount int64 `json:"touch_point_count" api:"required"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Normalized pressure of the first touch point, 0 to 1. + Force float64 `json:"force"` + // Bit field of held modifier keys (1=Alt, 2=Ctrl, 4=Meta, 8=Shift). + Modifiers int64 `json:"modifiers"` + // Horizontal radius of the first touch point. + RadiusX float64 `json:"radius_x"` + // Vertical radius of the first touch point. + RadiusY float64 `json:"radius_y"` + // Rotation of the first touch point, in degrees. + RotationAngle float64 `json:"rotation_angle"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // Normalized tangential pressure of the first touch point, -1 to 1. + TangentialPressure float64 `json:"tangential_pressure"` + // Tilt of the first touch point from the Y-Z plane, in degrees. + TiltX float64 `json:"tilt_x"` + // Tilt of the first touch point from the X-Z plane, in degrees. + TiltY float64 `json:"tilt_y"` + // Clockwise rotation of the first touch point, in degrees. + Twist int64 `json:"twist"` + // Viewport x coordinate of the first touch point. Touch coordinates live inside + // `touchPoints`, so this is the primary point rather than a command-level + // argument. + X float64 `json:"x"` + // Viewport y coordinate of the first touch point. + Y float64 `json:"y"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + EventType respjson.Field + Method respjson.Field + TouchPointCount respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + Force respjson.Field + Modifiers respjson.Field + RadiusX respjson.Field + RadiusY respjson.Field + RotationAngle respjson.Field + SessionID respjson.Field + TangentialPressure respjson.Field + TiltX respjson.Field + TiltY respjson.Field + Twist respjson.Field + X respjson.Field + Y respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataInputDispatchTouchEvent) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataInputDispatchTouchEvent) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Input.dispatchDragEvent` arguments. Canonical input: +// `Input.dispatchDragEvent` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataInputDispatchDragEvent struct { + // Drag event phase: `dragEnter`, `dragOver`, `drop` or `dragCancel`. A value the + // protocol does not define is reported as `other`. + // + // Any of "dragEnter", "dragOver", "drop", "dragCancel", "other". + EventType string `json:"event_type" api:"required"` + Method constant.InputDispatchDragEvent `json:"method" default:"Input.dispatchDragEvent"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Number of files in the drag payload. File paths are never captured. + DragFileCount int64 `json:"drag_file_count"` + // Number of items in the drag payload. Item contents are never captured. + DragItemCount int64 `json:"drag_item_count"` + // Distinct top-level MIME categories of the drag items (e.g. `text`, `image`, + // `application`). Subtypes and contents are never captured. A value the protocol + // does not define is reported as `other`. + // + // Any of "text", "image", "audio", "video", "application", "font", "model", + // "multipart", "message", "other". + DragMimeCategories []string `json:"drag_mime_categories"` + // Bit field of allowed drag operations (1=copy, 2=link, 16=move). + DragOperationsMask int64 `json:"drag_operations_mask"` + // Bit field of held modifier keys (1=Alt, 2=Ctrl, 4=Meta, 8=Shift). + Modifiers int64 `json:"modifiers"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // Viewport x coordinate in CSS pixels. + X float64 `json:"x"` + // Viewport y coordinate in CSS pixels. + Y float64 `json:"y"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + EventType respjson.Field + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + DragFileCount respjson.Field + DragItemCount respjson.Field + DragMimeCategories respjson.Field + DragOperationsMask respjson.Field + Modifiers respjson.Field + SessionID respjson.Field + X respjson.Field + Y respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataInputDispatchDragEvent) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataInputDispatchDragEvent) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Input.cancelDragging` arguments. Canonical input: +// `Input.cancelDragging` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataInputCancelDragging struct { + Method constant.InputCancelDragging `json:"method" default:"Input.cancelDragging"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataInputCancelDragging) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataInputCancelDragging) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Input.emulateTouchFromMouseEvent` arguments. Canonical input: +// `Input.emulateTouchFromMouseEvent` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataInputEmulateTouchFromMouseEvent struct { + // Mouse event phase being emulated as touch. A value the protocol does not define + // is reported as `other`. + // + // Any of "mousePressed", "mouseReleased", "mouseMoved", "mouseWheel", "other". + EventType string `json:"event_type" api:"required"` + Method constant.InputEmulateTouchFromMouseEvent `json:"method" default:"Input.emulateTouchFromMouseEvent"` + // Button named by the command. A value the protocol does not define is reported as + // `other`. + // + // Any of "none", "left", "middle", "right", "back", "forward", "other". + Button string `json:"button"` + // Number of times the button was clicked. + ClickCount int64 `json:"click_count"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Horizontal scroll delta. + DeltaX float64 `json:"delta_x"` + // Vertical scroll delta. + DeltaY float64 `json:"delta_y"` + // Bit field of held modifier keys (1=Alt, 2=Ctrl, 4=Meta, 8=Shift). + Modifiers int64 `json:"modifiers"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // Viewport x coordinate in CSS pixels. + X float64 `json:"x"` + // Viewport y coordinate in CSS pixels. + Y float64 `json:"y"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + EventType respjson.Field + Method respjson.Field + Button respjson.Field + ClickCount respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + DeltaX respjson.Field + DeltaY respjson.Field + Modifiers respjson.Field + SessionID respjson.Field + X respjson.Field + Y respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataInputEmulateTouchFromMouseEvent) RawJSON() string { + return r.JSON.raw +} +func (r *BrowserCdpCommandEventDataInputEmulateTouchFromMouseEvent) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Input.synthesizePinchGesture` arguments. Canonical input: +// `Input.synthesizePinchGesture` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataInputSynthesizePinchGesture struct { + Method constant.InputSynthesizePinchGesture `json:"method" default:"Input.synthesizePinchGesture"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Input source the synthesized gesture emulates. A value the protocol does not + // define is reported as `other`. + // + // Any of "default", "touch", "mouse", "other". + GestureSourceType string `json:"gesture_source_type"` + // Relative pointer speed, in pixels per second. + RelativeSpeed int64 `json:"relative_speed"` + // Relative scale of the pinch (>1 zooms in). + ScaleFactor float64 `json:"scale_factor"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // Viewport x coordinate in CSS pixels. + X float64 `json:"x"` + // Viewport y coordinate in CSS pixels. + Y float64 `json:"y"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + GestureSourceType respjson.Field + RelativeSpeed respjson.Field + ScaleFactor respjson.Field + SessionID respjson.Field + X respjson.Field + Y respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataInputSynthesizePinchGesture) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataInputSynthesizePinchGesture) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Input.synthesizeScrollGesture` arguments. Canonical input: +// `Input.synthesizeScrollGesture` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataInputSynthesizeScrollGesture struct { + Method constant.InputSynthesizeScrollGesture `json:"method" default:"Input.synthesizeScrollGesture"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Input source the synthesized gesture emulates. A value the protocol does not + // define is reported as `other`. + // + // Any of "default", "touch", "mouse", "other". + GestureSourceType string `json:"gesture_source_type"` + // Whether fling was suppressed. + PreventFling bool `json:"prevent_fling"` + // Number of additional repeats of the scroll. + RepeatCount int64 `json:"repeat_count"` + // Delay between repeats, in milliseconds. + RepeatDelayMs int64 `json:"repeat_delay_ms"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // Swipe speed in pixels per second. + Speed int64 `json:"speed"` + // Viewport x coordinate in CSS pixels. + X float64 `json:"x"` + // Horizontal scroll distance in CSS pixels; positive scrolls left. + XDistance float64 `json:"x_distance"` + // Additional horizontal distance scrolled past the end. + XOverscroll float64 `json:"x_overscroll"` + // Viewport y coordinate in CSS pixels. + Y float64 `json:"y"` + // Vertical scroll distance in CSS pixels; positive scrolls up. + YDistance float64 `json:"y_distance"` + // Additional vertical distance scrolled past the end. + YOverscroll float64 `json:"y_overscroll"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + GestureSourceType respjson.Field + PreventFling respjson.Field + RepeatCount respjson.Field + RepeatDelayMs respjson.Field + SessionID respjson.Field + Speed respjson.Field + X respjson.Field + XDistance respjson.Field + XOverscroll respjson.Field + Y respjson.Field + YDistance respjson.Field + YOverscroll respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataInputSynthesizeScrollGesture) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataInputSynthesizeScrollGesture) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Input.synthesizeTapGesture` arguments. Canonical input: +// `Input.synthesizeTapGesture` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataInputSynthesizeTapGesture struct { + Method constant.InputSynthesizeTapGesture `json:"method" default:"Input.synthesizeTapGesture"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Duration between touchdown and touchup, in milliseconds. + Duration int64 `json:"duration"` + // Input source the synthesized gesture emulates. A value the protocol does not + // define is reported as `other`. + // + // Any of "default", "touch", "mouse", "other". + GestureSourceType string `json:"gesture_source_type"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // Number of times to tap (2 is a double tap). + TapCount int64 `json:"tap_count"` + // Viewport x coordinate in CSS pixels. + X float64 `json:"x"` + // Viewport y coordinate in CSS pixels. + Y float64 `json:"y"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + Duration respjson.Field + GestureSourceType respjson.Field + SessionID respjson.Field + TapCount respjson.Field + X respjson.Field + Y respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataInputSynthesizeTapGesture) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataInputSynthesizeTapGesture) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `DOM.setFileInputFiles` arguments. Canonical input: +// `DOM.setFileInputFiles` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataDomSetFileInputFiles struct { + // Number of files handed to the input. File paths are never captured. + FileCount int64 `json:"file_count" api:"required"` + Method constant.DomSetFileInputFiles `json:"method" default:"DOM.setFileInputFiles"` + // Opaque backend DOM node identifier the command targeted. + BackendNodeID int64 `json:"backend_node_id"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Opaque DOM node identifier the command targeted. + NodeID int64 `json:"node_id"` + // Opaque Runtime remote object identifier the command targeted. Clipped to 128 + // characters; a longer value is not a real identifier. + ObjectID string `json:"object_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + FileCount respjson.Field + Method respjson.Field + BackendNodeID respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + NodeID respjson.Field + ObjectID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataDomSetFileInputFiles) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataDomSetFileInputFiles) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `DOM.focus` arguments. Canonical input: `DOM.focus` in +// devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataDomFocus struct { + Method constant.DomFocus `json:"method" default:"DOM.focus"` + // Opaque backend DOM node identifier the command targeted. + BackendNodeID int64 `json:"backend_node_id"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Opaque DOM node identifier the command targeted. + NodeID int64 `json:"node_id"` + // Opaque Runtime remote object identifier the command targeted. Clipped to 128 + // characters; a longer value is not a real identifier. + ObjectID string `json:"object_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + BackendNodeID respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + NodeID respjson.Field + ObjectID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataDomFocus) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataDomFocus) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `DOM.scrollIntoViewIfNeeded` arguments. Canonical input: +// `DOM.scrollIntoViewIfNeeded` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataDomScrollIntoViewIfNeeded struct { + Method constant.DomScrollIntoViewIfNeeded `json:"method" default:"DOM.scrollIntoViewIfNeeded"` + // Opaque backend DOM node identifier the command targeted. + BackendNodeID int64 `json:"backend_node_id"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Opaque DOM node identifier the command targeted. + NodeID int64 `json:"node_id"` + // Opaque Runtime remote object identifier the command targeted. Clipped to 128 + // characters; a longer value is not a real identifier. + ObjectID string `json:"object_id"` + // Height of the rect the command scrolled to. + RectHeight float64 `json:"rect_height"` + // Width of the rect the command scrolled to. + RectWidth float64 `json:"rect_width"` + // X offset of the rect the command scrolled to, relative to the node. + RectX float64 `json:"rect_x"` + // Y offset of the rect the command scrolled to, relative to the node. + RectY float64 `json:"rect_y"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + BackendNodeID respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + NodeID respjson.Field + ObjectID respjson.Field + RectHeight respjson.Field + RectWidth respjson.Field + RectX respjson.Field + RectY respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataDomScrollIntoViewIfNeeded) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataDomScrollIntoViewIfNeeded) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Page.bringToFront` arguments. Canonical input: `Page.bringToFront` in +// devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataPageBringToFront struct { + Method constant.PageBringToFront `json:"method" default:"Page.bringToFront"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataPageBringToFront) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataPageBringToFront) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Page.captureScreenshot` arguments. Canonical input: +// `Page.captureScreenshot` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataPageCaptureScreenshot struct { + Method constant.PageCaptureScreenshot `json:"method" default:"Page.captureScreenshot"` + // Whether the capture extended past the viewport. + CaptureBeyondViewport bool `json:"capture_beyond_viewport"` + // Clip region height in CSS pixels. + ClipHeight float64 `json:"clip_height"` + // Clip region page scale factor. + ClipScale float64 `json:"clip_scale"` + // Clip region width in CSS pixels. + ClipWidth float64 `json:"clip_width"` + // Clip region x offset in CSS pixels. + ClipX float64 `json:"clip_x"` + // Clip region y offset in CSS pixels. + ClipY float64 `json:"clip_y"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Image format requested (`jpeg`, `png` or `webp`). A value the protocol does not + // define is reported as `other`. + // + // Any of "jpeg", "png", "webp", "other". + Format string `json:"format"` + // Whether the capture was taken from the surface rather than the view. + FromSurface bool `json:"from_surface"` + // Whether encoding favored speed over size. + OptimizeForSpeed bool `json:"optimize_for_speed"` + // Compression quality, 0 to 100, for lossy formats. + Quality int64 `json:"quality"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CaptureBeyondViewport respjson.Field + ClipHeight respjson.Field + ClipScale respjson.Field + ClipWidth respjson.Field + ClipX respjson.Field + ClipY respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + Format respjson.Field + FromSurface respjson.Field + OptimizeForSpeed respjson.Field + Quality respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataPageCaptureScreenshot) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataPageCaptureScreenshot) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Page.captureSnapshot` arguments. Canonical input: +// `Page.captureSnapshot` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataPageCaptureSnapshot struct { + Method constant.PageCaptureSnapshot `json:"method" default:"Page.captureSnapshot"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Snapshot format requested (`mhtml`). A value the protocol does not define is + // reported as `other`. + // + // Any of "mhtml", "other". + Format string `json:"format"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + Format respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataPageCaptureSnapshot) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataPageCaptureSnapshot) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Page.handleJavaScriptDialog` arguments. Canonical input: +// `Page.handleJavaScriptDialog` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataPageHandleJavaScriptDialog struct { + // Whether the dialog was accepted or dismissed. + Accept bool `json:"accept" api:"required"` + Method constant.PageHandleJavaScriptDialog `json:"method" default:"Page.handleJavaScriptDialog"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Number of characters entered into a prompt dialog. The text itself is never + // captured. + PromptTextLength int64 `json:"prompt_text_length"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Accept respjson.Field + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + PromptTextLength respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataPageHandleJavaScriptDialog) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataPageHandleJavaScriptDialog) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Page.navigate` arguments. Canonical input: `Page.navigate` in +// devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataPageNavigate struct { + Method constant.PageNavigate `json:"method" default:"Page.navigate"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Opaque frame identifier. Clipped to 128 characters; a longer value is not a real + // identifier. + FrameID string `json:"frame_id"` + // Referrer policy named by the command. A value the protocol does not define is + // reported as `other`. + // + // Any of "noReferrer", "noReferrerWhenDowngrade", "origin", + // "originWhenCrossOrigin", "sameOrigin", "strictOrigin", + // "strictOriginWhenCrossOrigin", "unsafeUrl", "other". + ReferrerPolicy string `json:"referrer_policy"` + // Whether the command carried a referrer. The referrer itself is never captured. + ReferrerPresent bool `json:"referrer_present"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // Navigation reason reported by the caller (e.g. `link`, `typed`, `reload`). A + // value the protocol does not define is reported as `other`. + // + // Any of "link", "typed", "address_bar", "auto_bookmark", "auto_subframe", + // "manual_subframe", "generated", "auto_toplevel", "form_submit", "reload", + // "keyword", "keyword_generated", "other". + TransitionType string `json:"transition_type"` + // Scheme of the destination URL (e.g. `https`, `about`, `data`). The rest of the + // URL is never captured. + URLScheme string `json:"url_scheme"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + FrameID respjson.Field + ReferrerPolicy respjson.Field + ReferrerPresent respjson.Field + SessionID respjson.Field + TransitionType respjson.Field + URLScheme respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataPageNavigate) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataPageNavigate) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Page.navigateToHistoryEntry` arguments. Canonical input: +// `Page.navigateToHistoryEntry` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataPageNavigateToHistoryEntry struct { + // History entry the command navigated to. + EntryID int64 `json:"entry_id" api:"required"` + Method constant.PageNavigateToHistoryEntry `json:"method" default:"Page.navigateToHistoryEntry"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + EntryID respjson.Field + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataPageNavigateToHistoryEntry) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataPageNavigateToHistoryEntry) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Page.reload` arguments. Canonical input: `Page.reload` in +// devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataPageReload struct { + Method constant.PageReload `json:"method" default:"Page.reload"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Whether the reload bypassed the cache. + IgnoreCache bool `json:"ignore_cache"` + // Opaque document loader identifier. Clipped to 128 characters; a longer value is + // not a real identifier. + LoaderID string `json:"loader_id"` + // Number of characters in the injected script. + ScriptLength int64 `json:"script_length"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + IgnoreCache respjson.Field + LoaderID respjson.Field + ScriptLength respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataPageReload) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataPageReload) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Page.printToPDF` arguments. Canonical input: `Page.printToPDF` in +// devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataPagePrintToPdf struct { + Method constant.PagePrintToPdf `json:"method" default:"Page.printToPDF"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Whether a header and footer were rendered. + DisplayHeaderFooter bool `json:"display_header_footer"` + // Whether a footer template was supplied. The template itself is never captured. + FooterTemplatePresent bool `json:"footer_template_present"` + // Whether a document outline was embedded. + GenerateDocumentOutline bool `json:"generate_document_outline"` + // Whether a tagged (accessible) PDF was requested. + GenerateTaggedPdf bool `json:"generate_tagged_pdf"` + // Whether a header template was supplied. The template itself is never captured. + HeaderTemplatePresent bool `json:"header_template_present"` + // Whether the page was laid out in landscape. + Landscape bool `json:"landscape"` + // Bottom margin in inches. + MarginBottom float64 `json:"margin_bottom"` + // Left margin in inches. + MarginLeft float64 `json:"margin_left"` + // Right margin in inches. + MarginRight float64 `json:"margin_right"` + // Top margin in inches. + MarginTop float64 `json:"margin_top"` + // Whether a page range was supplied. + PageRangesPresent bool `json:"page_ranges_present"` + // Paper height in inches. + PaperHeight float64 `json:"paper_height"` + // Paper width in inches. + PaperWidth float64 `json:"paper_width"` + // Whether the CSS page size was preferred over the paper size. + PreferCssPageSize bool `json:"prefer_css_page_size"` + // Whether background graphics were printed. + PrintBackground bool `json:"print_background"` + // Page render scale. + Scale float64 `json:"scale"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // How the PDF was returned (`ReturnAsBase64` or `ReturnAsStream`). A value the + // protocol does not define is reported as `other`. + // + // Any of "ReturnAsBase64", "ReturnAsStream", "other". + TransferMode string `json:"transfer_mode"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + DisplayHeaderFooter respjson.Field + FooterTemplatePresent respjson.Field + GenerateDocumentOutline respjson.Field + GenerateTaggedPdf respjson.Field + HeaderTemplatePresent respjson.Field + Landscape respjson.Field + MarginBottom respjson.Field + MarginLeft respjson.Field + MarginRight respjson.Field + MarginTop respjson.Field + PageRangesPresent respjson.Field + PaperHeight respjson.Field + PaperWidth respjson.Field + PreferCssPageSize respjson.Field + PrintBackground respjson.Field + Scale respjson.Field + SessionID respjson.Field + TransferMode respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataPagePrintToPdf) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataPagePrintToPdf) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Page.startScreencast` arguments. Canonical input: +// `Page.startScreencast` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataPageStartScreencast struct { + Method constant.PageStartScreencast `json:"method" default:"Page.startScreencast"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Frame sampling interval. + EveryNthFrame int64 `json:"every_nth_frame"` + // Frame format requested (`jpeg` or `png`). A value the protocol does not define + // is reported as `other`. + // + // Any of "jpeg", "png", "other". + Format string `json:"format"` + // Maximum frame height in pixels. + MaxHeight int64 `json:"max_height"` + // Maximum frame width in pixels. + MaxWidth int64 `json:"max_width"` + // Compression quality, 0 to 100. + Quality int64 `json:"quality"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + EveryNthFrame respjson.Field + Format respjson.Field + MaxHeight respjson.Field + MaxWidth respjson.Field + Quality respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataPageStartScreencast) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataPageStartScreencast) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Page.stopScreencast` arguments. Canonical input: +// `Page.stopScreencast` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataPageStopScreencast struct { + Method constant.PageStopScreencast `json:"method" default:"Page.stopScreencast"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataPageStopScreencast) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataPageStopScreencast) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Page.stopLoading` arguments. Canonical input: `Page.stopLoading` in +// devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataPageStopLoading struct { + Method constant.PageStopLoading `json:"method" default:"Page.stopLoading"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataPageStopLoading) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataPageStopLoading) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Page.close` arguments. Canonical input: `Page.close` in +// devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataPageClose struct { + Method constant.PageClose `json:"method" default:"Page.close"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataPageClose) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataPageClose) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Page.setWebLifecycleState` arguments. Canonical input: +// `Page.setWebLifecycleState` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataPageSetWebLifecycleState struct { + Method constant.PageSetWebLifecycleState `json:"method" default:"Page.setWebLifecycleState"` + // Lifecycle state applied (`frozen` or `active`). A value the protocol does not + // define is reported as `other`. + // + // Any of "frozen", "active", "other". + State string `json:"state" api:"required"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + State respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataPageSetWebLifecycleState) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataPageSetWebLifecycleState) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Target.activateTarget` arguments. Canonical input: +// `Target.activateTarget` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataTargetActivateTarget struct { + Method constant.TargetActivateTarget `json:"method" default:"Target.activateTarget"` + // Opaque target identifier. Clipped to 128 characters; a longer value is not a + // real identifier. + TargetID string `json:"target_id" api:"required"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + TargetID respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataTargetActivateTarget) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataTargetActivateTarget) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Target.closeTarget` arguments. Canonical input: `Target.closeTarget` +// in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataTargetCloseTarget struct { + Method constant.TargetCloseTarget `json:"method" default:"Target.closeTarget"` + // Opaque target identifier. Clipped to 128 characters; a longer value is not a + // real identifier. + TargetID string `json:"target_id" api:"required"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + TargetID respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataTargetCloseTarget) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataTargetCloseTarget) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Target.createTarget` arguments. Canonical input: +// `Target.createTarget` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataTargetCreateTarget struct { + Method constant.TargetCreateTarget `json:"method" default:"Target.createTarget"` + // Whether the target was created in the background. + Background bool `json:"background"` + // Opaque browser context identifier. Clipped to 128 characters; a longer value is + // not a real identifier. + BrowserContextID string `json:"browser_context_id"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Whether BeginFrame control was enabled (headless only). + EnableBeginFrameControl bool `json:"enable_begin_frame_control"` + // Whether the new target was focused. + Focus bool `json:"focus"` + // Whether a tab target rather than a page target was created. + ForTab bool `json:"for_tab"` + // Window height in DIP. + Height int64 `json:"height"` + // Whether the target was created hidden. + Hidden bool `json:"hidden"` + // Window x position in screen coordinates. + Left int64 `json:"left"` + // Whether a new window was requested. + NewWindow bool `json:"new_window"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // Window y position in screen coordinates. + Top int64 `json:"top"` + // Scheme of the destination URL (e.g. `https`, `about`, `data`). The rest of the + // URL is never captured. + URLScheme string `json:"url_scheme"` + // Window width in DIP. + Width int64 `json:"width"` + // Window state requested (`normal`, `minimized`, `maximized`, `fullscreen`). A + // value the protocol does not define is reported as `other`. + // + // Any of "normal", "minimized", "maximized", "fullscreen", "other". + WindowState string `json:"window_state"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + Background respjson.Field + BrowserContextID respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + EnableBeginFrameControl respjson.Field + Focus respjson.Field + ForTab respjson.Field + Height respjson.Field + Hidden respjson.Field + Left respjson.Field + NewWindow respjson.Field + SessionID respjson.Field + Top respjson.Field + URLScheme respjson.Field + Width respjson.Field + WindowState respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataTargetCreateTarget) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataTargetCreateTarget) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Target.createBrowserContext` arguments. Canonical input: +// `Target.createBrowserContext` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataTargetCreateBrowserContext struct { + Method constant.TargetCreateBrowserContext `json:"method" default:"Target.createBrowserContext"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Whether the context is disposed when the debugging session detaches. + DisposeOnDetach bool `json:"dispose_on_detach"` + // Whether a proxy bypass list was configured. + ProxyBypassListPresent bool `json:"proxy_bypass_list_present"` + // Whether a proxy was configured. The proxy address is never captured. + ProxyServerPresent bool `json:"proxy_server_present"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // Number of origins granted universal network access. The origins themselves are + // never captured. + UniversalNetworkAccessOriginCount int64 `json:"universal_network_access_origin_count"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + DisposeOnDetach respjson.Field + ProxyBypassListPresent respjson.Field + ProxyServerPresent respjson.Field + SessionID respjson.Field + UniversalNetworkAccessOriginCount respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataTargetCreateBrowserContext) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataTargetCreateBrowserContext) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Target.disposeBrowserContext` arguments. Canonical input: +// `Target.disposeBrowserContext` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataTargetDisposeBrowserContext struct { + // Opaque browser context identifier. Clipped to 128 characters; a longer value is + // not a real identifier. + BrowserContextID string `json:"browser_context_id" api:"required"` + Method constant.TargetDisposeBrowserContext `json:"method" default:"Target.disposeBrowserContext"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + BrowserContextID respjson.Field + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataTargetDisposeBrowserContext) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataTargetDisposeBrowserContext) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Target.openDevTools` arguments. Canonical input: +// `Target.openDevTools` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataTargetOpenDevTools struct { + Method constant.TargetOpenDevTools `json:"method" default:"Target.openDevTools"` + // Opaque target identifier. Clipped to 128 characters; a longer value is not a + // real identifier. + TargetID string `json:"target_id" api:"required"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // DevTools panel opened. Clipped to 128 characters; a longer value is not a real + // identifier. + PanelID string `json:"panel_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + TargetID respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + PanelID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataTargetOpenDevTools) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataTargetOpenDevTools) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Browser.cancelDownload` arguments. Canonical input: +// `Browser.cancelDownload` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataBrowserCancelDownload struct { + // Opaque identifier of the download that was cancelled. Clipped to 128 characters; + // a longer value is not a real identifier. + DownloadGuid string `json:"download_guid" api:"required"` + Method constant.BrowserCancelDownload `json:"method" default:"Browser.cancelDownload"` + // Opaque browser context identifier. Clipped to 128 characters; a longer value is + // not a real identifier. + BrowserContextID string `json:"browser_context_id"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + DownloadGuid respjson.Field + Method respjson.Field + BrowserContextID respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataBrowserCancelDownload) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataBrowserCancelDownload) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Browser.close` arguments. Canonical input: `Browser.close` in +// devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataBrowserClose struct { + Method constant.BrowserClose `json:"method" default:"Browser.close"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataBrowserClose) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataBrowserClose) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Browser.setWindowBounds` arguments. Canonical input: +// `Browser.setWindowBounds` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataBrowserSetWindowBounds struct { + Method constant.BrowserSetWindowBounds `json:"method" default:"Browser.setWindowBounds"` + // Browser window identifier. + WindowID int64 `json:"window_id" api:"required"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Window height in DIP. + Height int64 `json:"height"` + // Window x position in screen coordinates. + Left int64 `json:"left"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // Window y position in screen coordinates. + Top int64 `json:"top"` + // Window width in DIP. + Width int64 `json:"width"` + // Window state requested (`normal`, `minimized`, `maximized`, `fullscreen`). A + // value the protocol does not define is reported as `other`. + // + // Any of "normal", "minimized", "maximized", "fullscreen", "other". + WindowState string `json:"window_state"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + WindowID respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + Height respjson.Field + Left respjson.Field + SessionID respjson.Field + Top respjson.Field + Width respjson.Field + WindowState respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataBrowserSetWindowBounds) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataBrowserSetWindowBounds) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Browser.setContentsSize` arguments. Canonical input: +// `Browser.setContentsSize` in devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataBrowserSetContentsSize struct { + Method constant.BrowserSetContentsSize `json:"method" default:"Browser.setContentsSize"` + // Browser window identifier. + WindowID int64 `json:"window_id" api:"required"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Contents height in DIP. + Height int64 `json:"height"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` + // Contents width in DIP. + Width int64 `json:"width"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Method respjson.Field + WindowID respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + Height respjson.Field + SessionID respjson.Field + Width respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpCommandEventDataBrowserSetContentsSize) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataBrowserSetContentsSize) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Sanitized `Autofill.trigger` arguments. Canonical input: `Autofill.trigger` in +// devtools-protocol@2d019e73, pinned at +// https://github.com/ChromeDevTools/devtools-protocol/blob/2d019e73eb371d1d6985d26d395d78bd8f8a22ba/json/browser_protocol.json. +// Every argument of this command has a retained or redacted decision in +// lib/devtoolsproxy/testdata/cdp_arguments.yaml. +type BrowserCdpCommandEventDataAutofillTrigger struct { + // Opaque backend node identifier of the field that was autofilled. + FieldID int64 `json:"field_id" api:"required"` + Method constant.AutofillTrigger `json:"method" default:"Autofill.trigger"` + // Number of address fields the command filled. Their names and values are never + // captured. + AddressFieldCount int64 `json:"address_field_count"` + // The command's JSON-RPC id, so the command can be joined to the result the + // browser returned for it. Absent when the client sent none. + CommandID int64 `json:"command_id"` + // Identifies the CDP proxy connection the command arrived on, matching + // `cdp_connect` and `cdp_disconnect`. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Opaque frame identifier. Clipped to 128 characters; a longer value is not a real + // identifier. + FrameID string `json:"frame_id"` + // What was filled: `card` or `address`. The values themselves are never captured. // - // Any of "success", "failure", "timeout", "abandoned". - Status string `json:"status" api:"required"` - // Solver-specific error code on failure (e.g. ERROR_CAPTCHA_UNSOLVABLE). Absent on - // success. - ErrorCode string `json:"error_code"` - // Solver-assigned identifier. Opaque, useful for support cross-references. - TaskID string `json:"task_id"` - // Host of the page where the captcha was solved. - WebsiteHost string `json:"website_host"` - // Path of the page where the captcha was solved. Query string excluded. - WebsitePath string `json:"website_path"` + // Any of "card", "address". + Mode string `json:"mode"` + // CDP session identifier the command was addressed to. Absent for browser-level + // commands. Clipped to 128 characters. + SessionID string `json:"session_id"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { - CaptchaType respjson.Field - DurationMs respjson.Field - Status respjson.Field - ErrorCode respjson.Field - TaskID respjson.Field - WebsiteHost respjson.Field - WebsitePath respjson.Field - ExtraFields map[string]respjson.Field - raw string + FieldID respjson.Field + Method respjson.Field + AddressFieldCount respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + FrameID respjson.Field + Mode respjson.Field + SessionID respjson.Field + ExtraFields map[string]respjson.Field + raw string } `json:"-"` } // Returns the unmodified JSON received from the API -func (r BrowserCaptchaSolveResultEventData) RawJSON() string { return r.JSON.raw } -func (r *BrowserCaptchaSolveResultEventData) UnmarshalJSON(data []byte) error { +func (r BrowserCdpCommandEventDataAutofillTrigger) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpCommandEventDataAutofillTrigger) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// A browser-control CDP method the proxy reports. The set covers the commands an +// agent drives the browser with; configuration, DOM and Runtime bookkeeping, and +// Chrome-specific UI commands are outside it. Canonical definitions: +// devtools-protocol@2d019e73. +type BrowserCdpCommandMethod string + +const ( + BrowserCdpCommandMethodInputDispatchMouseEvent BrowserCdpCommandMethod = "Input.dispatchMouseEvent" + BrowserCdpCommandMethodInputDispatchKeyEvent BrowserCdpCommandMethod = "Input.dispatchKeyEvent" + BrowserCdpCommandMethodInputInsertText BrowserCdpCommandMethod = "Input.insertText" + BrowserCdpCommandMethodInputImeSetComposition BrowserCdpCommandMethod = "Input.imeSetComposition" + BrowserCdpCommandMethodInputDispatchTouchEvent BrowserCdpCommandMethod = "Input.dispatchTouchEvent" + BrowserCdpCommandMethodInputDispatchDragEvent BrowserCdpCommandMethod = "Input.dispatchDragEvent" + BrowserCdpCommandMethodInputCancelDragging BrowserCdpCommandMethod = "Input.cancelDragging" + BrowserCdpCommandMethodInputEmulateTouchFromMouseEvent BrowserCdpCommandMethod = "Input.emulateTouchFromMouseEvent" + BrowserCdpCommandMethodInputSynthesizePinchGesture BrowserCdpCommandMethod = "Input.synthesizePinchGesture" + BrowserCdpCommandMethodInputSynthesizeScrollGesture BrowserCdpCommandMethod = "Input.synthesizeScrollGesture" + BrowserCdpCommandMethodInputSynthesizeTapGesture BrowserCdpCommandMethod = "Input.synthesizeTapGesture" + BrowserCdpCommandMethodDomSetFileInputFiles BrowserCdpCommandMethod = "DOM.setFileInputFiles" + BrowserCdpCommandMethodDomFocus BrowserCdpCommandMethod = "DOM.focus" + BrowserCdpCommandMethodDomScrollIntoViewIfNeeded BrowserCdpCommandMethod = "DOM.scrollIntoViewIfNeeded" + BrowserCdpCommandMethodPageBringToFront BrowserCdpCommandMethod = "Page.bringToFront" + BrowserCdpCommandMethodPageCaptureScreenshot BrowserCdpCommandMethod = "Page.captureScreenshot" + BrowserCdpCommandMethodPageCaptureSnapshot BrowserCdpCommandMethod = "Page.captureSnapshot" + BrowserCdpCommandMethodPageHandleJavaScriptDialog BrowserCdpCommandMethod = "Page.handleJavaScriptDialog" + BrowserCdpCommandMethodPageNavigate BrowserCdpCommandMethod = "Page.navigate" + BrowserCdpCommandMethodPageNavigateToHistoryEntry BrowserCdpCommandMethod = "Page.navigateToHistoryEntry" + BrowserCdpCommandMethodPageReload BrowserCdpCommandMethod = "Page.reload" + BrowserCdpCommandMethodPagePrintToPdf BrowserCdpCommandMethod = "Page.printToPDF" + BrowserCdpCommandMethodPageStartScreencast BrowserCdpCommandMethod = "Page.startScreencast" + BrowserCdpCommandMethodPageStopScreencast BrowserCdpCommandMethod = "Page.stopScreencast" + BrowserCdpCommandMethodPageStopLoading BrowserCdpCommandMethod = "Page.stopLoading" + BrowserCdpCommandMethodPageClose BrowserCdpCommandMethod = "Page.close" + BrowserCdpCommandMethodPageSetWebLifecycleState BrowserCdpCommandMethod = "Page.setWebLifecycleState" + BrowserCdpCommandMethodTargetActivateTarget BrowserCdpCommandMethod = "Target.activateTarget" + BrowserCdpCommandMethodTargetCloseTarget BrowserCdpCommandMethod = "Target.closeTarget" + BrowserCdpCommandMethodTargetCreateTarget BrowserCdpCommandMethod = "Target.createTarget" + BrowserCdpCommandMethodTargetCreateBrowserContext BrowserCdpCommandMethod = "Target.createBrowserContext" + BrowserCdpCommandMethodTargetDisposeBrowserContext BrowserCdpCommandMethod = "Target.disposeBrowserContext" + BrowserCdpCommandMethodTargetOpenDevTools BrowserCdpCommandMethod = "Target.openDevTools" + BrowserCdpCommandMethodBrowserCancelDownload BrowserCdpCommandMethod = "Browser.cancelDownload" + BrowserCdpCommandMethodBrowserClose BrowserCdpCommandMethod = "Browser.close" + BrowserCdpCommandMethodBrowserSetWindowBounds BrowserCdpCommandMethod = "Browser.setWindowBounds" + BrowserCdpCommandMethodBrowserSetContentsSize BrowserCdpCommandMethod = "Browser.setContentsSize" + BrowserCdpCommandMethodAutofillTrigger BrowserCdpCommandMethod = "Autofill.trigger" +) + // An external client (e.g. customer SDK, Playwright, Puppeteer) connected to the // CDP WebSocket proxy on this VM. type BrowserCdpConnectEvent struct { @@ -298,8 +3106,9 @@ type BrowserCdpConnectEvent struct { // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. - Ts int64 `json:"ts" api:"required"` - Type constant.CdpConnect `json:"type" default:"cdp_connect"` + Ts int64 `json:"ts" api:"required"` + Type constant.CdpConnect `json:"type" default:"cdp_connect"` + Data BrowserCdpConnectEventData `json:"data"` // True if the data field was truncated due to size limits. Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. @@ -308,6 +3117,7 @@ type BrowserCdpConnectEvent struct { Source respjson.Field Ts respjson.Field Type respjson.Field + Data respjson.Field Truncated respjson.Field ExtraFields map[string]respjson.Field raw string @@ -320,6 +3130,25 @@ func (r *BrowserCdpConnectEvent) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +type BrowserCdpConnectEventData struct { + // Identifies this CDP proxy connection, matching the connection_id on the + // cdp_command events that arrived on it. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + ConnectionID respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserCdpConnectEventData) RawJSON() string { return r.JSON.raw } +func (r *BrowserCdpConnectEventData) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // An external client disconnected from the CDP WebSocket proxy on this VM. Pair // with the immediately preceding cdp_connect on the same stream. type BrowserCdpDisconnectEvent struct { @@ -365,13 +3194,31 @@ type BrowserCdpDisconnectEventData struct { // Any of "client_close", "upstream_changed", "upstream_error", // "context_cancelled". Reason string `json:"reason" api:"required"` + // Identifies this CDP proxy connection, matching the connection_id on the + // cdp_command events that arrived on it. Two clients driving the same browser are + // told apart by this. + ConnectionID string `json:"connection_id"` + // Number of forwarded client frames the classifier never saw, because it could not + // keep up or because classification failed. An upper bound on lost commands rather + // than a count: a saturated queue turns away whatever arrives next, which may be + // library traffic that would have produced no event. Telemetry loss only; every + // command was still relayed to the browser. Absent on events from a browser image + // predating the field, which is not the same as zero. + TelemetryDropped int64 `json:"telemetry_dropped"` + // Number of forwarded client commands that produced no cdp_command event because + // their method is listed in control.cdp.excluded_methods. Configuration rather + // than loss, so it is counted apart from telemetry_dropped. + TelemetryExcluded int64 `json:"telemetry_excluded"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { - DurationMs respjson.Field - MessageCount respjson.Field - Reason respjson.Field - ExtraFields map[string]respjson.Field - raw string + DurationMs respjson.Field + MessageCount respjson.Field + Reason respjson.Field + ConnectionID respjson.Field + TelemetryDropped respjson.Field + TelemetryExcluded respjson.Field + ExtraFields map[string]respjson.Field + raw string } `json:"-"` } @@ -1429,6 +4276,64 @@ func (r *BrowserNetworkResponseEventData) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// A page's renderer process crashed (an "Aw, Snap!" failure) while the browser +// process itself stayed alive. Reported on the crashed page's session, with the +// session and target ids on `source.metadata`. Captured only while the `page` +// category is enabled. +type BrowserPageCrashedEvent struct { + Category constant.Page `json:"category" default:"page"` + // Provenance metadata identifying which producer emitted the event. + Source BrowserEventSource `json:"source" api:"required"` + // Event timestamp in Unix microseconds. + Ts int64 `json:"ts" api:"required"` + Type constant.PageCrashed `json:"type" default:"page_crashed"` + Data BrowserPageCrashedEventData `json:"data"` + // True if the data field was truncated due to size limits. + Truncated bool `json:"truncated"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Category respjson.Field + Source respjson.Field + Ts respjson.Field + Type respjson.Field + Data respjson.Field + Truncated respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserPageCrashedEvent) RawJSON() string { return r.JSON.raw } +func (r *BrowserPageCrashedEvent) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +type BrowserPageCrashedEventData struct { + // CDP target identifier of the crashed page. + TargetID string `json:"target_id" api:"required"` + // CDP target type of the page that produced the event. + // + // Any of "page", "background_page", "service_worker", "shared_worker", "other". + TargetType string `json:"target_type" api:"required"` + // URL the page was on when its renderer process crashed. + URL string `json:"url" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + TargetID respjson.Field + TargetType respjson.Field + URL respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserPageCrashedEventData) RawJSON() string { return r.JSON.raw } +func (r *BrowserPageCrashedEventData) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // A browser DOMContentLoaded event (CDP Page.domContentEventFired). type BrowserPageDomContentLoadedEvent struct { Category constant.Page `json:"category" default:"page"` @@ -1925,6 +4830,66 @@ func (r *BrowserPageTabOpenedEventData) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// An HTTP call that manages the browser VM rather than driving the browser, +// handled by the in-VM API server — recording lifecycle, filesystem and process +// management, telemetry and browser configuration. Mostly platform-induced (e.g. +// profile save, replay capture) rather than agent actions. +type BrowserPlatformAPICallEvent struct { + Category constant.Platform `json:"category" default:"platform"` + // Provenance metadata identifying which producer emitted the event. + Source BrowserEventSource `json:"source" api:"required"` + // Event timestamp in Unix microseconds. + Ts int64 `json:"ts" api:"required"` + Type constant.PlatformAPICall `json:"type" default:"platform_api_call"` + Data BrowserPlatformAPICallEventData `json:"data"` + // True if the data field was truncated due to size limits. + Truncated bool `json:"truncated"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Category respjson.Field + Source respjson.Field + Ts respjson.Field + Type respjson.Field + Data respjson.Field + Truncated respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserPlatformAPICallEvent) RawJSON() string { return r.JSON.raw } +func (r *BrowserPlatformAPICallEvent) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +type BrowserPlatformAPICallEventData struct { + // Wall-clock duration of the handler in milliseconds. + DurationMs float64 `json:"duration_ms" api:"required"` + // Matched route's operation, named as the in-VM API names its handler (e.g. + // ProcessExec, StartRecording). + OperationID string `json:"operation_id" api:"required"` + // Per-request identifier from the in-VM API request middleware. + RequestID string `json:"request_id" api:"required"` + // HTTP response status code. + Status int64 `json:"status" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + DurationMs respjson.Field + OperationID respjson.Field + RequestID respjson.Field + Status respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserPlatformAPICallEventData) RawJSON() string { return r.JSON.raw } +func (r *BrowserPlatformAPICallEventData) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // A branded proxy-layer failure observed by the browser. Emitted when the metro // egress host-proxy serves a branded 5xx error page whose response carries the // X-Kernel-Proxy-Error header. Low-volume and carries a typed code. Its value is @@ -2176,8 +5141,8 @@ func (r *BrowserSystemOomKillEventDataTopTask) UnmarshalJSON(data []byte) error // Per-category telemetry capture settings layered onto the default set. The // operational signals (control, connection, system, captcha) are on by default and // are opt-out: set one to enabled=false to stop capturing it. The CDP categories -// (console, network, page, interaction) and screenshot are off by default and are -// opt-in: set enabled=true to capture them. +// (console, network, page, interaction), screenshot and platform are off by +// default and are opt-in: set enabled=true to capture them. type BrowserTelemetryCategoriesConfig struct { // Captcha solve attempt outcomes. On by default. Captcha BrowserTelemetryCategoryConfig `json:"captcha"` @@ -2186,9 +5151,10 @@ type BrowserTelemetryCategoriesConfig struct { // Console output (log, warn, error) and uncaught exceptions. CDP category; off by // default. Console BrowserTelemetryCategoryConfig `json:"console"` - // Agent-driven actions against the browser, such as inbound calls to the in-VM - // API. On by default. - Control BrowserTelemetryCategoryConfig `json:"control"` + // Agent-driven actions against the browser — computer-control calls, Playwright + // code execution, screenshots, clipboard access, and browser-control commands sent + // over the CDP proxy. On by default. + Control BrowserTelemetryControlConfig `json:"control"` // User interaction events including clicks, keydowns, and scroll-settled events. // CDP category; off by default. Interaction BrowserTelemetryCategoryConfig `json:"interaction"` @@ -2201,6 +5167,10 @@ type BrowserTelemetryCategoriesConfig struct { // Page lifecycle events including navigation, DOMContentLoaded, load, layout // shifts, and LCP. CDP category; off by default. Page BrowserTelemetryCategoryConfig `json:"page"` + // In-VM API calls that manage the browser VM rather than drive the browser + // (recording, filesystem, process, telemetry and browser configuration). Mostly + // platform-induced; off by default and must be opted into. + Platform BrowserTelemetryCategoryConfig `json:"platform"` // Periodic base64-encoded viewport screenshots. High volume; off by default and // must be opted into. Screenshot BrowserTelemetryCategoryConfig `json:"screenshot"` @@ -2216,6 +5186,7 @@ type BrowserTelemetryCategoriesConfig struct { Interaction respjson.Field Network respjson.Field Page respjson.Field + Platform respjson.Field Screenshot respjson.Field System respjson.Field ExtraFields map[string]respjson.Field @@ -2242,8 +5213,8 @@ func (r BrowserTelemetryCategoriesConfig) ToParam() BrowserTelemetryCategoriesCo // Per-category telemetry capture settings layered onto the default set. The // operational signals (control, connection, system, captcha) are on by default and // are opt-out: set one to enabled=false to stop capturing it. The CDP categories -// (console, network, page, interaction) and screenshot are off by default and are -// opt-in: set enabled=true to capture them. +// (console, network, page, interaction), screenshot and platform are off by +// default and are opt-in: set enabled=true to capture them. type BrowserTelemetryCategoriesConfigParam struct { // Captcha solve attempt outcomes. On by default. Captcha BrowserTelemetryCategoryConfigParam `json:"captcha,omitzero"` @@ -2252,9 +5223,10 @@ type BrowserTelemetryCategoriesConfigParam struct { // Console output (log, warn, error) and uncaught exceptions. CDP category; off by // default. Console BrowserTelemetryCategoryConfigParam `json:"console,omitzero"` - // Agent-driven actions against the browser, such as inbound calls to the in-VM - // API. On by default. - Control BrowserTelemetryCategoryConfigParam `json:"control,omitzero"` + // Agent-driven actions against the browser — computer-control calls, Playwright + // code execution, screenshots, clipboard access, and browser-control commands sent + // over the CDP proxy. On by default. + Control BrowserTelemetryControlConfigParam `json:"control,omitzero"` // User interaction events including clicks, keydowns, and scroll-settled events. // CDP category; off by default. Interaction BrowserTelemetryCategoryConfigParam `json:"interaction,omitzero"` @@ -2267,6 +5239,10 @@ type BrowserTelemetryCategoriesConfigParam struct { // Page lifecycle events including navigation, DOMContentLoaded, load, layout // shifts, and LCP. CDP category; off by default. Page BrowserTelemetryCategoryConfigParam `json:"page,omitzero"` + // In-VM API calls that manage the browser VM rather than drive the browser + // (recording, filesystem, process, telemetry and browser configuration). Mostly + // platform-induced; off by default and must be opted into. + Platform BrowserTelemetryCategoryConfigParam `json:"platform,omitzero"` // Periodic base64-encoded viewport screenshots. High volume; off by default and // must be opted into. Screenshot BrowserTelemetryCategoryConfigParam `json:"screenshot,omitzero"` @@ -2288,7 +5264,8 @@ func (r *BrowserTelemetryCategoriesConfigParam) UnmarshalJSON(data []byte) error type BrowserTelemetryCategoryConfig struct { // Whether this category is captured. Operational categories (control, connection, // system, captcha) default to true; set false to opt out. CDP categories (console, - // network, page, interaction) and screenshot default to false; set true to opt in. + // network, page, interaction), screenshot and platform default to false; set true + // to opt in. Enabled bool `json:"enabled"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { @@ -2318,7 +5295,8 @@ func (r BrowserTelemetryCategoryConfig) ToParam() BrowserTelemetryCategoryConfig type BrowserTelemetryCategoryConfigParam struct { // Whether this category is captured. Operational categories (control, connection, // system, captcha) default to true; set false to opt out. CDP categories (console, - // network, page, interaction) and screenshot default to false; set true to opt in. + // network, page, interaction), screenshot and platform default to false; set true + // to opt in. Enabled param.Opt[bool] `json:"enabled,omitzero"` paramObj } @@ -2331,6 +5309,63 @@ func (r *BrowserTelemetryCategoryConfigParam) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// Settings for the cdp_command events the CDP proxy reports. +type BrowserTelemetryCdpControlConfig struct { + // Methods to leave out of the cdp_command stream. Omit the list to keep the + // current one; send an empty list to report every supported method again. + // Exclusion is a telemetry setting only: an excluded command is still relayed to + // the browser unchanged, it simply produces no event. Use it to drop the + // highest-volume methods — Input.dispatchMouseEvent during a humanized cursor + // path, or Page.captureScreenshot under a screencast — without turning the whole + // category off. Excluded commands are counted in + // cdp_disconnect.telemetry_excluded. + ExcludedMethods []BrowserCdpCommandMethod `json:"excluded_methods"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + ExcludedMethods respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserTelemetryCdpControlConfig) RawJSON() string { return r.JSON.raw } +func (r *BrowserTelemetryCdpControlConfig) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// ToParam converts this BrowserTelemetryCdpControlConfig to a +// BrowserTelemetryCdpControlConfigParam. +// +// Warning: the fields of the param type will not be present. ToParam should only +// be used at the last possible moment before sending a request. Test for this with +// BrowserTelemetryCdpControlConfigParam.Overrides() +func (r BrowserTelemetryCdpControlConfig) ToParam() BrowserTelemetryCdpControlConfigParam { + return param.Override[BrowserTelemetryCdpControlConfigParam](json.RawMessage(r.RawJSON())) +} + +// Settings for the cdp_command events the CDP proxy reports. +type BrowserTelemetryCdpControlConfigParam struct { + // Methods to leave out of the cdp_command stream. Omit the list to keep the + // current one; send an empty list to report every supported method again. + // Exclusion is a telemetry setting only: an excluded command is still relayed to + // the browser unchanged, it simply produces no event. Use it to drop the + // highest-volume methods — Input.dispatchMouseEvent during a humanized cursor + // path, or Page.captureScreenshot under a screencast — without turning the whole + // category off. Excluded commands are counted in + // cdp_disconnect.telemetry_excluded. + ExcludedMethods []BrowserCdpCommandMethod `json:"excluded_methods,omitzero"` + paramObj +} + +func (r BrowserTelemetryCdpControlConfigParam) MarshalJSON() (data []byte, err error) { + type shadow BrowserTelemetryCdpControlConfigParam + return param.MarshalObject(r, (*shadow)(&r)) +} +func (r *BrowserTelemetryCdpControlConfigParam) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Active telemetry configuration for a browser session. type BrowserTelemetryConfig struct { // Per-category enable/disable flags. @@ -2353,19 +5388,76 @@ func (r *BrowserTelemetryConfig) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// Configuration for the control category. Same enabled semantics as any other +// category, plus settings for the browser-control commands the CDP proxy reports. +type BrowserTelemetryControlConfig struct { + // Settings for the cdp_command events the CDP proxy reports. Merged independently + // of enabled, so a later update that only sets enabled keeps the current exclusion + // list. + Cdp BrowserTelemetryCdpControlConfig `json:"cdp"` + // Whether this category is captured. Control is on by default; set false to opt + // out. + Enabled bool `json:"enabled"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Cdp respjson.Field + Enabled respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserTelemetryControlConfig) RawJSON() string { return r.JSON.raw } +func (r *BrowserTelemetryControlConfig) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// ToParam converts this BrowserTelemetryControlConfig to a +// BrowserTelemetryControlConfigParam. +// +// Warning: the fields of the param type will not be present. ToParam should only +// be used at the last possible moment before sending a request. Test for this with +// BrowserTelemetryControlConfigParam.Overrides() +func (r BrowserTelemetryControlConfig) ToParam() BrowserTelemetryControlConfigParam { + return param.Override[BrowserTelemetryControlConfigParam](json.RawMessage(r.RawJSON())) +} + +// Configuration for the control category. Same enabled semantics as any other +// category, plus settings for the browser-control commands the CDP proxy reports. +type BrowserTelemetryControlConfigParam struct { + // Whether this category is captured. Control is on by default; set false to opt + // out. + Enabled param.Opt[bool] `json:"enabled,omitzero"` + // Settings for the cdp_command events the CDP proxy reports. Merged independently + // of enabled, so a later update that only sets enabled keeps the current exclusion + // list. + Cdp BrowserTelemetryCdpControlConfigParam `json:"cdp,omitzero"` + paramObj +} + +func (r BrowserTelemetryControlConfigParam) MarshalJSON() (data []byte, err error) { + type shadow BrowserTelemetryControlConfigParam + return param.MarshalObject(r, (*shadow)(&r)) +} +func (r *BrowserTelemetryControlConfigParam) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // BrowserTelemetryEventUnion contains all possible properties and values from // [BrowserConsoleLogEvent], [BrowserConsoleErrorEvent], // [BrowserNetworkRequestEvent], [BrowserNetworkResponseEvent], // [BrowserNetworkLoadingFailedEvent], [BrowserNetworkIdleEvent], // [BrowserProxyErrorEvent], [BrowserPageNavigationEvent], // [BrowserPageDomContentLoadedEvent], [BrowserPageLoadEvent], -// [BrowserPageTabOpenedEvent], [BrowserPageLayoutShiftEvent], -// [BrowserPageLcpEvent], [BrowserPageLayoutSettledEvent], -// [BrowserPageNavigationSettledEvent], [BrowserInteractionClickEvent], -// [BrowserInteractionKeyEvent], [BrowserInteractionScrollSettledEvent], -// [BrowserMonitorScreenshotEvent], [BrowserMonitorDisconnectedEvent], -// [BrowserMonitorReconnectedEvent], [BrowserMonitorReconnectFailedEvent], -// [BrowserMonitorInitFailedEvent], [BrowserAPICallEvent], +// [BrowserPageTabOpenedEvent], [BrowserPageCrashedEvent], +// [BrowserPageLayoutShiftEvent], [BrowserPageLcpEvent], +// [BrowserPageLayoutSettledEvent], [BrowserPageNavigationSettledEvent], +// [BrowserInteractionClickEvent], [BrowserInteractionKeyEvent], +// [BrowserInteractionScrollSettledEvent], [BrowserMonitorScreenshotEvent], +// [BrowserMonitorDisconnectedEvent], [BrowserMonitorReconnectedEvent], +// [BrowserMonitorReconnectFailedEvent], [BrowserMonitorInitFailedEvent], +// [BrowserAPICallEvent], [BrowserPlatformAPICallEvent], [BrowserCdpCommandEvent], // [BrowserCdpConnectEvent], [BrowserCdpDisconnectEvent], // [BrowserLiveViewConnectEvent], [BrowserLiveViewDisconnectEvent], // [BrowserCaptchaSolveResultEvent], [BrowserSystemOomKillEvent], @@ -2381,13 +5473,14 @@ type BrowserTelemetryEventUnion struct { Ts int64 `json:"ts"` // Any of "console_log", "console_error", "network_request", "network_response", // "network_loading_failed", "network_idle", "proxy_error", "page_navigation", - // "page_dom_content_loaded", "page_load", "page_tab_opened", "page_layout_shift", - // "page_lcp", "page_layout_settled", "page_navigation_settled", - // "interaction_click", "interaction_key", "interaction_scroll_settled", - // "monitor_screenshot", "monitor_disconnected", "monitor_reconnected", - // "monitor_reconnect_failed", "monitor_init_failed", "api_call", "cdp_connect", - // "cdp_disconnect", "live_view_connect", "live_view_disconnect", - // "captcha_solve_result", "system_oom_kill", "service_crashed". + // "page_dom_content_loaded", "page_load", "page_tab_opened", "page_crashed", + // "page_layout_shift", "page_lcp", "page_layout_settled", + // "page_navigation_settled", "interaction_click", "interaction_key", + // "interaction_scroll_settled", "monitor_screenshot", "monitor_disconnected", + // "monitor_reconnected", "monitor_reconnect_failed", "monitor_init_failed", + // "api_call", "platform_api_call", "cdp_command", "cdp_connect", "cdp_disconnect", + // "live_view_connect", "live_view_disconnect", "captcha_solve_result", + // "system_oom_kill", "service_crashed". Type string `json:"type"` // This field is a union of [BrowserConsoleLogEventData], // [BrowserConsoleErrorEventData], [BrowserNetworkRequestEventData], @@ -2395,12 +5488,14 @@ type BrowserTelemetryEventUnion struct { // [BrowserEventContext], [BrowserProxyErrorEventData], // [BrowserPageNavigationEventData], [BrowserPageDomContentLoadedEventData], // [BrowserPageLoadEventData], [BrowserPageTabOpenedEventData], - // [BrowserPageLayoutShiftEventData], [BrowserPageLcpEventData], - // [BrowserInteractionClickEventData], [BrowserInteractionKeyEventData], - // [BrowserInteractionScrollSettledEventData], [BrowserMonitorScreenshotEventData], - // [BrowserMonitorDisconnectedEventData], [BrowserMonitorReconnectedEventData], - // [BrowserMonitorReconnectFailedEventData], [BrowserMonitorInitFailedEventData], - // [BrowserAPICallEventData], [BrowserCdpDisconnectEventData], + // [BrowserPageCrashedEventData], [BrowserPageLayoutShiftEventData], + // [BrowserPageLcpEventData], [BrowserInteractionClickEventData], + // [BrowserInteractionKeyEventData], [BrowserInteractionScrollSettledEventData], + // [BrowserMonitorScreenshotEventData], [BrowserMonitorDisconnectedEventData], + // [BrowserMonitorReconnectedEventData], [BrowserMonitorReconnectFailedEventData], + // [BrowserMonitorInitFailedEventData], [BrowserAPICallEventData], + // [BrowserPlatformAPICallEventData], [BrowserCdpCommandEventDataUnion], + // [BrowserCdpConnectEventData], [BrowserCdpDisconnectEventData], // [BrowserLiveViewConnectEventData], [BrowserLiveViewDisconnectEventData], // [BrowserCaptchaSolveResultEventData], [BrowserSystemOomKillEventData], // [BrowserServiceCrashedEventData] @@ -2435,6 +5530,7 @@ func (BrowserPageNavigationEvent) implBrowserTelemetryEventUnion() {} func (BrowserPageDomContentLoadedEvent) implBrowserTelemetryEventUnion() {} func (BrowserPageLoadEvent) implBrowserTelemetryEventUnion() {} func (BrowserPageTabOpenedEvent) implBrowserTelemetryEventUnion() {} +func (BrowserPageCrashedEvent) implBrowserTelemetryEventUnion() {} func (BrowserPageLayoutShiftEvent) implBrowserTelemetryEventUnion() {} func (BrowserPageLcpEvent) implBrowserTelemetryEventUnion() {} func (BrowserPageLayoutSettledEvent) implBrowserTelemetryEventUnion() {} @@ -2448,6 +5544,8 @@ func (BrowserMonitorReconnectedEvent) implBrowserTelemetryEventUnion() {} func (BrowserMonitorReconnectFailedEvent) implBrowserTelemetryEventUnion() {} func (BrowserMonitorInitFailedEvent) implBrowserTelemetryEventUnion() {} func (BrowserAPICallEvent) implBrowserTelemetryEventUnion() {} +func (BrowserPlatformAPICallEvent) implBrowserTelemetryEventUnion() {} +func (BrowserCdpCommandEvent) implBrowserTelemetryEventUnion() {} func (BrowserCdpConnectEvent) implBrowserTelemetryEventUnion() {} func (BrowserCdpDisconnectEvent) implBrowserTelemetryEventUnion() {} func (BrowserLiveViewConnectEvent) implBrowserTelemetryEventUnion() {} @@ -2470,6 +5568,7 @@ func (BrowserServiceCrashedEvent) implBrowserTelemetryEventUnion() {} // case kernel.BrowserPageDomContentLoadedEvent: // case kernel.BrowserPageLoadEvent: // case kernel.BrowserPageTabOpenedEvent: +// case kernel.BrowserPageCrashedEvent: // case kernel.BrowserPageLayoutShiftEvent: // case kernel.BrowserPageLcpEvent: // case kernel.BrowserPageLayoutSettledEvent: @@ -2483,6 +5582,8 @@ func (BrowserServiceCrashedEvent) implBrowserTelemetryEventUnion() {} // case kernel.BrowserMonitorReconnectFailedEvent: // case kernel.BrowserMonitorInitFailedEvent: // case kernel.BrowserAPICallEvent: +// case kernel.BrowserPlatformAPICallEvent: +// case kernel.BrowserCdpCommandEvent: // case kernel.BrowserCdpConnectEvent: // case kernel.BrowserCdpDisconnectEvent: // case kernel.BrowserLiveViewConnectEvent: @@ -2517,6 +5618,8 @@ func (u BrowserTelemetryEventUnion) AsAny() anyBrowserTelemetryEvent { return u.AsPageLoad() case "page_tab_opened": return u.AsPageTabOpened() + case "page_crashed": + return u.AsPageCrashed() case "page_layout_shift": return u.AsPageLayoutShift() case "page_lcp": @@ -2543,6 +5646,10 @@ func (u BrowserTelemetryEventUnion) AsAny() anyBrowserTelemetryEvent { return u.AsMonitorInitFailed() case "api_call": return u.AsAPICall() + case "platform_api_call": + return u.AsPlatformAPICall() + case "cdp_command": + return u.AsCdpCommand() case "cdp_connect": return u.AsCdpConnect() case "cdp_disconnect": @@ -2616,6 +5723,11 @@ func (u BrowserTelemetryEventUnion) AsPageTabOpened() (v BrowserPageTabOpenedEve return } +func (u BrowserTelemetryEventUnion) AsPageCrashed() (v BrowserPageCrashedEvent) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + func (u BrowserTelemetryEventUnion) AsPageLayoutShift() (v BrowserPageLayoutShiftEvent) { apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) return @@ -2681,6 +5793,16 @@ func (u BrowserTelemetryEventUnion) AsAPICall() (v BrowserAPICallEvent) { return } +func (u BrowserTelemetryEventUnion) AsPlatformAPICall() (v BrowserPlatformAPICallEvent) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u BrowserTelemetryEventUnion) AsCdpCommand() (v BrowserCdpCommandEvent) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + func (u BrowserTelemetryEventUnion) AsCdpConnect() (v BrowserCdpConnectEvent) { apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) return @@ -2775,7 +5897,7 @@ type BrowserTelemetryEventUnionData struct { Body string `json:"body"` // This field is from variant [BrowserNetworkResponseEventData]. MimeType string `json:"mime_type"` - // This field is a union of [int64], [int64], [int64], [string] + // This field is a union of [int64], [int64], [int64], [int64], [string] Status BrowserTelemetryEventUnionDataStatus `json:"status"` // This field is from variant [BrowserNetworkResponseEventData]. StatusText string `json:"status_text"` @@ -2783,8 +5905,7 @@ type BrowserTelemetryEventUnionData struct { Canceled bool `json:"canceled"` // This field is from variant [BrowserNetworkLoadingFailedEventData]. ErrorText string `json:"error_text"` - // This field is from variant [BrowserProxyErrorEventData]. - Code string `json:"code"` + Code string `json:"code"` // This field is from variant [BrowserPageNavigationEventData]. ParentFrameID string `json:"parent_frame_id"` CdpTimestamp float64 `json:"cdp_timestamp"` @@ -2792,8 +5913,8 @@ type BrowserTelemetryEventUnionData struct { OpenerID string `json:"opener_id"` // This field is from variant [BrowserPageTabOpenedEventData]. Title string `json:"title"` - // This field is from variant [BrowserPageLayoutShiftEventData]. - Duration float64 `json:"duration"` + // This field is a union of [float64], [int64] + Duration BrowserTelemetryEventUnionDataDuration `json:"duration"` // This field is from variant [BrowserPageLayoutShiftEventData]. LayoutShiftDetails BrowserPageLayoutShiftEventDataLayoutShiftDetails `json:"layout_shift_details"` SourceFrameID string `json:"source_frame_id"` @@ -2802,10 +5923,12 @@ type BrowserTelemetryEventUnionData struct { LcpDetails BrowserPageLcpEventDataLcpDetails `json:"lcp_details"` Selector string `json:"selector"` Tag string `json:"tag"` - // This field is from variant [BrowserInteractionClickEventData]. - X int64 `json:"x"` - // This field is from variant [BrowserInteractionClickEventData]. - Y int64 `json:"y"` + // This field is a union of [int64], [float64], [float64], [float64], [float64], + // [float64], [float64], [float64] + X BrowserTelemetryEventUnionDataX `json:"x"` + // This field is a union of [int64], [float64], [float64], [float64], [float64], + // [float64], [float64], [float64] + Y BrowserTelemetryEventUnionDataY `json:"y"` // This field is from variant [BrowserInteractionKeyEventData]. Key string `json:"key"` // This field is from variant [BrowserInteractionScrollSettledEventData]. @@ -2824,12 +5947,219 @@ type BrowserTelemetryEventUnionData struct { // This field is from variant [BrowserMonitorReconnectedEventData]. ReconnectDurationMs int64 `json:"reconnect_duration_ms"` // This field is from variant [BrowserMonitorInitFailedEventData]. - Step string `json:"step"` - DurationMs float64 `json:"duration_ms"` - // This field is from variant [BrowserAPICallEventData]. - OperationID string `json:"operation_id"` + Step string `json:"step"` + DurationMs float64 `json:"duration_ms"` + OperationID string `json:"operation_id"` + EventType string `json:"event_type"` + Button string `json:"button"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + Buttons int64 `json:"buttons"` + ClickCount int64 `json:"click_count"` + CommandID int64 `json:"command_id"` + ConnectionID string `json:"connection_id"` + DeltaX float64 `json:"delta_x"` + DeltaY float64 `json:"delta_y"` + Force float64 `json:"force"` + Modifiers int64 `json:"modifiers"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + PointerType string `json:"pointer_type"` + TangentialPressure float64 `json:"tangential_pressure"` + TiltX float64 `json:"tilt_x"` + TiltY float64 `json:"tilt_y"` + Twist int64 `json:"twist"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + AutoRepeat bool `json:"auto_repeat"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + CommandCount int64 `json:"command_count"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + IsKeypad bool `json:"is_keypad"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + IsSystemKey bool `json:"is_system_key"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + Location int64 `json:"location"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + NamedKey string `json:"named_key"` + TextLength int64 `json:"text_length"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ReplacementEnd int64 `json:"replacement_end"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ReplacementStart int64 `json:"replacement_start"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + SelectionEnd int64 `json:"selection_end"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + SelectionStart int64 `json:"selection_start"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + TouchPointCount int64 `json:"touch_point_count"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + RadiusX float64 `json:"radius_x"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + RadiusY float64 `json:"radius_y"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + RotationAngle float64 `json:"rotation_angle"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + DragFileCount int64 `json:"drag_file_count"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + DragItemCount int64 `json:"drag_item_count"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + DragMimeCategories []string `json:"drag_mime_categories"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + DragOperationsMask int64 `json:"drag_operations_mask"` + GestureSourceType string `json:"gesture_source_type"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + RelativeSpeed int64 `json:"relative_speed"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ScaleFactor float64 `json:"scale_factor"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + PreventFling bool `json:"prevent_fling"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + RepeatCount int64 `json:"repeat_count"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + RepeatDelayMs int64 `json:"repeat_delay_ms"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + Speed int64 `json:"speed"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + XDistance float64 `json:"x_distance"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + XOverscroll float64 `json:"x_overscroll"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + YDistance float64 `json:"y_distance"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + YOverscroll float64 `json:"y_overscroll"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + TapCount int64 `json:"tap_count"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + FileCount int64 `json:"file_count"` + BackendNodeID int64 `json:"backend_node_id"` + NodeID int64 `json:"node_id"` + ObjectID string `json:"object_id"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + RectHeight float64 `json:"rect_height"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + RectWidth float64 `json:"rect_width"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + RectX float64 `json:"rect_x"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + RectY float64 `json:"rect_y"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + CaptureBeyondViewport bool `json:"capture_beyond_viewport"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ClipHeight float64 `json:"clip_height"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ClipScale float64 `json:"clip_scale"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ClipWidth float64 `json:"clip_width"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ClipX float64 `json:"clip_x"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ClipY float64 `json:"clip_y"` + Format string `json:"format"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + FromSurface bool `json:"from_surface"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + OptimizeForSpeed bool `json:"optimize_for_speed"` + Quality int64 `json:"quality"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + Accept bool `json:"accept"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + PromptTextLength int64 `json:"prompt_text_length"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ReferrerPolicy string `json:"referrer_policy"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ReferrerPresent bool `json:"referrer_present"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + TransitionType string `json:"transition_type"` + URLScheme string `json:"url_scheme"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + EntryID int64 `json:"entry_id"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + IgnoreCache bool `json:"ignore_cache"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ScriptLength int64 `json:"script_length"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + DisplayHeaderFooter bool `json:"display_header_footer"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + FooterTemplatePresent bool `json:"footer_template_present"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + GenerateDocumentOutline bool `json:"generate_document_outline"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + GenerateTaggedPdf bool `json:"generate_tagged_pdf"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + HeaderTemplatePresent bool `json:"header_template_present"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + Landscape bool `json:"landscape"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + MarginBottom float64 `json:"margin_bottom"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + MarginLeft float64 `json:"margin_left"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + MarginRight float64 `json:"margin_right"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + MarginTop float64 `json:"margin_top"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + PageRangesPresent bool `json:"page_ranges_present"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + PaperHeight float64 `json:"paper_height"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + PaperWidth float64 `json:"paper_width"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + PreferCssPageSize bool `json:"prefer_css_page_size"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + PrintBackground bool `json:"print_background"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + Scale float64 `json:"scale"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + TransferMode string `json:"transfer_mode"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + EveryNthFrame int64 `json:"every_nth_frame"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + MaxHeight int64 `json:"max_height"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + MaxWidth int64 `json:"max_width"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + State string `json:"state"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + Background bool `json:"background"` + BrowserContextID string `json:"browser_context_id"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + EnableBeginFrameControl bool `json:"enable_begin_frame_control"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + Focus bool `json:"focus"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ForTab bool `json:"for_tab"` + Height int64 `json:"height"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + Hidden bool `json:"hidden"` + Left int64 `json:"left"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + NewWindow bool `json:"new_window"` + Top int64 `json:"top"` + Width int64 `json:"width"` + WindowState string `json:"window_state"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + DisposeOnDetach bool `json:"dispose_on_detach"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ProxyBypassListPresent bool `json:"proxy_bypass_list_present"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + ProxyServerPresent bool `json:"proxy_server_present"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + UniversalNetworkAccessOriginCount int64 `json:"universal_network_access_origin_count"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + PanelID string `json:"panel_id"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + DownloadGuid string `json:"download_guid"` + WindowID int64 `json:"window_id"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + FieldID int64 `json:"field_id"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + AddressFieldCount int64 `json:"address_field_count"` + // This field is from variant [BrowserCdpCommandEventDataUnion]. + Mode string `json:"mode"` // This field is from variant [BrowserCdpDisconnectEventData]. MessageCount int64 `json:"message_count"` + // This field is from variant [BrowserCdpDisconnectEventData]. + TelemetryDropped int64 `json:"telemetry_dropped"` + // This field is from variant [BrowserCdpDisconnectEventData]. + TelemetryExcluded int64 `json:"telemetry_excluded"` // This field is from variant [BrowserCaptchaSolveResultEventData]. CaptchaType string `json:"captcha_type"` // This field is from variant [BrowserCaptchaSolveResultEventData]. @@ -2862,79 +6192,197 @@ type BrowserTelemetryEventUnionData struct { // This field is from variant [BrowserServiceCrashedEventData]. ServiceName string `json:"service_name"` JSON struct { - FrameID respjson.Field - LoaderID respjson.Field - NavSeq respjson.Field - SessionID respjson.Field - TargetID respjson.Field - TargetType respjson.Field - URL respjson.Field - Args respjson.Field - Level respjson.Field - StackTrace respjson.Field - Text respjson.Field - Column respjson.Field - Line respjson.Field - SourceURL respjson.Field - DocumentURL respjson.Field - Headers respjson.Field - InitiatorType respjson.Field - IsRedirect respjson.Field - Method respjson.Field - PostData respjson.Field - RedirectURL respjson.Field - RequestID respjson.Field - ResourceType respjson.Field - Body respjson.Field - MimeType respjson.Field - Status respjson.Field - StatusText respjson.Field - Canceled respjson.Field - ErrorText respjson.Field - Code respjson.Field - ParentFrameID respjson.Field - CdpTimestamp respjson.Field - OpenerID respjson.Field - Title respjson.Field - Duration respjson.Field - LayoutShiftDetails respjson.Field - SourceFrameID respjson.Field - Time respjson.Field - LcpDetails respjson.Field - Selector respjson.Field - Tag respjson.Field - X respjson.Field - Y respjson.Field - Key respjson.Field - FromX respjson.Field - FromY respjson.Field - TargetSelector respjson.Field - ToX respjson.Field - ToY respjson.Field - Png respjson.Field - Reason respjson.Field - ReconnectDurationMs respjson.Field - Step respjson.Field - DurationMs respjson.Field - OperationID respjson.Field - MessageCount respjson.Field - CaptchaType respjson.Field - ErrorCode respjson.Field - TaskID respjson.Field - WebsiteHost respjson.Field - WebsitePath respjson.Field - Pid respjson.Field - ProcessName respjson.Field - RssKB respjson.Field - Constraint respjson.Field - MemFreeKB respjson.Field - MemTotalKB respjson.Field - TopTasks respjson.Field - TriggerPid respjson.Field - TriggerProcessName respjson.Field - Phase respjson.Field - ServiceName respjson.Field - raw string + FrameID respjson.Field + LoaderID respjson.Field + NavSeq respjson.Field + SessionID respjson.Field + TargetID respjson.Field + TargetType respjson.Field + URL respjson.Field + Args respjson.Field + Level respjson.Field + StackTrace respjson.Field + Text respjson.Field + Column respjson.Field + Line respjson.Field + SourceURL respjson.Field + DocumentURL respjson.Field + Headers respjson.Field + InitiatorType respjson.Field + IsRedirect respjson.Field + Method respjson.Field + PostData respjson.Field + RedirectURL respjson.Field + RequestID respjson.Field + ResourceType respjson.Field + Body respjson.Field + MimeType respjson.Field + Status respjson.Field + StatusText respjson.Field + Canceled respjson.Field + ErrorText respjson.Field + Code respjson.Field + ParentFrameID respjson.Field + CdpTimestamp respjson.Field + OpenerID respjson.Field + Title respjson.Field + Duration respjson.Field + LayoutShiftDetails respjson.Field + SourceFrameID respjson.Field + Time respjson.Field + LcpDetails respjson.Field + Selector respjson.Field + Tag respjson.Field + X respjson.Field + Y respjson.Field + Key respjson.Field + FromX respjson.Field + FromY respjson.Field + TargetSelector respjson.Field + ToX respjson.Field + ToY respjson.Field + Png respjson.Field + Reason respjson.Field + ReconnectDurationMs respjson.Field + Step respjson.Field + DurationMs respjson.Field + OperationID respjson.Field + EventType respjson.Field + Button respjson.Field + Buttons respjson.Field + ClickCount respjson.Field + CommandID respjson.Field + ConnectionID respjson.Field + DeltaX respjson.Field + DeltaY respjson.Field + Force respjson.Field + Modifiers respjson.Field + PointerType respjson.Field + TangentialPressure respjson.Field + TiltX respjson.Field + TiltY respjson.Field + Twist respjson.Field + AutoRepeat respjson.Field + CommandCount respjson.Field + IsKeypad respjson.Field + IsSystemKey respjson.Field + Location respjson.Field + NamedKey respjson.Field + TextLength respjson.Field + ReplacementEnd respjson.Field + ReplacementStart respjson.Field + SelectionEnd respjson.Field + SelectionStart respjson.Field + TouchPointCount respjson.Field + RadiusX respjson.Field + RadiusY respjson.Field + RotationAngle respjson.Field + DragFileCount respjson.Field + DragItemCount respjson.Field + DragMimeCategories respjson.Field + DragOperationsMask respjson.Field + GestureSourceType respjson.Field + RelativeSpeed respjson.Field + ScaleFactor respjson.Field + PreventFling respjson.Field + RepeatCount respjson.Field + RepeatDelayMs respjson.Field + Speed respjson.Field + XDistance respjson.Field + XOverscroll respjson.Field + YDistance respjson.Field + YOverscroll respjson.Field + TapCount respjson.Field + FileCount respjson.Field + BackendNodeID respjson.Field + NodeID respjson.Field + ObjectID respjson.Field + RectHeight respjson.Field + RectWidth respjson.Field + RectX respjson.Field + RectY respjson.Field + CaptureBeyondViewport respjson.Field + ClipHeight respjson.Field + ClipScale respjson.Field + ClipWidth respjson.Field + ClipX respjson.Field + ClipY respjson.Field + Format respjson.Field + FromSurface respjson.Field + OptimizeForSpeed respjson.Field + Quality respjson.Field + Accept respjson.Field + PromptTextLength respjson.Field + ReferrerPolicy respjson.Field + ReferrerPresent respjson.Field + TransitionType respjson.Field + URLScheme respjson.Field + EntryID respjson.Field + IgnoreCache respjson.Field + ScriptLength respjson.Field + DisplayHeaderFooter respjson.Field + FooterTemplatePresent respjson.Field + GenerateDocumentOutline respjson.Field + GenerateTaggedPdf respjson.Field + HeaderTemplatePresent respjson.Field + Landscape respjson.Field + MarginBottom respjson.Field + MarginLeft respjson.Field + MarginRight respjson.Field + MarginTop respjson.Field + PageRangesPresent respjson.Field + PaperHeight respjson.Field + PaperWidth respjson.Field + PreferCssPageSize respjson.Field + PrintBackground respjson.Field + Scale respjson.Field + TransferMode respjson.Field + EveryNthFrame respjson.Field + MaxHeight respjson.Field + MaxWidth respjson.Field + State respjson.Field + Background respjson.Field + BrowserContextID respjson.Field + EnableBeginFrameControl respjson.Field + Focus respjson.Field + ForTab respjson.Field + Height respjson.Field + Hidden respjson.Field + Left respjson.Field + NewWindow respjson.Field + Top respjson.Field + Width respjson.Field + WindowState respjson.Field + DisposeOnDetach respjson.Field + ProxyBypassListPresent respjson.Field + ProxyServerPresent respjson.Field + UniversalNetworkAccessOriginCount respjson.Field + PanelID respjson.Field + DownloadGuid respjson.Field + WindowID respjson.Field + FieldID respjson.Field + AddressFieldCount respjson.Field + Mode respjson.Field + MessageCount respjson.Field + TelemetryDropped respjson.Field + TelemetryExcluded respjson.Field + CaptchaType respjson.Field + ErrorCode respjson.Field + TaskID respjson.Field + WebsiteHost respjson.Field + WebsitePath respjson.Field + Pid respjson.Field + ProcessName respjson.Field + RssKB respjson.Field + Constraint respjson.Field + MemFreeKB respjson.Field + MemTotalKB respjson.Field + TopTasks respjson.Field + TriggerPid respjson.Field + TriggerProcessName respjson.Field + Phase respjson.Field + ServiceName respjson.Field + raw string } `json:"-"` } @@ -2967,6 +6415,81 @@ func (r *BrowserTelemetryEventUnionDataStatus) UnmarshalJSON(data []byte) error return apijson.UnmarshalRoot(data, r) } +// BrowserTelemetryEventUnionDataDuration is an implicit subunion of +// [BrowserTelemetryEventUnion]. BrowserTelemetryEventUnionDataDuration provides +// convenient access to the sub-properties of the union. +// +// For type safety it is recommended to directly use a variant of the +// [BrowserTelemetryEventUnion]. +// +// If the underlying value is not a json object, one of the following properties +// will be valid: OfFloat OfInt] +type BrowserTelemetryEventUnionDataDuration struct { + // This field will be present if the value is a [float64] instead of an object. + OfFloat float64 `json:",inline"` + // This field will be present if the value is a [int64] instead of an object. + OfInt int64 `json:",inline"` + JSON struct { + OfFloat respjson.Field + OfInt respjson.Field + raw string + } `json:"-"` +} + +func (r *BrowserTelemetryEventUnionDataDuration) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// BrowserTelemetryEventUnionDataX is an implicit subunion of +// [BrowserTelemetryEventUnion]. BrowserTelemetryEventUnionDataX provides +// convenient access to the sub-properties of the union. +// +// For type safety it is recommended to directly use a variant of the +// [BrowserTelemetryEventUnion]. +// +// If the underlying value is not a json object, one of the following properties +// will be valid: OfInt OfFloat] +type BrowserTelemetryEventUnionDataX struct { + // This field will be present if the value is a [int64] instead of an object. + OfInt int64 `json:",inline"` + // This field will be present if the value is a [float64] instead of an object. + OfFloat float64 `json:",inline"` + JSON struct { + OfInt respjson.Field + OfFloat respjson.Field + raw string + } `json:"-"` +} + +func (r *BrowserTelemetryEventUnionDataX) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// BrowserTelemetryEventUnionDataY is an implicit subunion of +// [BrowserTelemetryEventUnion]. BrowserTelemetryEventUnionDataY provides +// convenient access to the sub-properties of the union. +// +// For type safety it is recommended to directly use a variant of the +// [BrowserTelemetryEventUnion]. +// +// If the underlying value is not a json object, one of the following properties +// will be valid: OfInt OfFloat] +type BrowserTelemetryEventUnionDataY struct { + // This field will be present if the value is a [int64] instead of an object. + OfInt int64 `json:",inline"` + // This field will be present if the value is a [float64] instead of an object. + OfFloat float64 `json:",inline"` + JSON struct { + OfInt respjson.Field + OfFloat respjson.Field + raw string + } `json:"-"` +} + +func (r *BrowserTelemetryEventUnionDataY) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Active export state for a session's captured telemetry, by protocol. type BrowserTelemetryExportConfig struct { // Active OTLP export state. @@ -3095,8 +6618,8 @@ type BrowserTelemetryEventsParams struct { // Restrict results to these event categories. Repeat the parameter for multiple // values. // - // Any of "console", "network", "page", "interaction", "control", "connection", - // "system", "screenshot", "captcha", "monitor". + // Any of "console", "network", "page", "interaction", "control", "platform", + // "connection", "system", "screenshot", "captcha", "monitor". Category []string `query:"category,omitzero" json:"-"` paramObj } diff --git a/proxy.go b/proxy.go index 4f2f179..8ed5bce 100644 --- a/proxy.go +++ b/proxy.go @@ -100,7 +100,10 @@ func (r *ProxyService) ListAutoPaging(ctx context.Context, query ProxyListParams return pagination.NewOffsetPaginationAutoPager(r.List(ctx, query, opts...)) } -// Soft delete a proxy. Sessions referencing it are not modified. +// Soft delete a proxy. Session records referencing it are not modified. If egress +// binding polling is enabled, existing tunnels for active sessions using the proxy +// are terminated within one polling interval; subsequent connections through the +// deleted proxy are rejected. func (r *ProxyService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error) { opts = slices.Concat(r.Options, opts) opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...) diff --git a/shared/constant/constants.go b/shared/constant/constants.go index a6bd9e3..931b507 100644 --- a/shared/constant/constants.go +++ b/shared/constant/constants.go @@ -18,73 +18,145 @@ func ValueOf[T Constant[T]]() T { return t.Default() } -type APICall string // Always "api_call" -type AppVersionSummary string // Always "app_version_summary" -type AwsUsEast1a string // Always "aws.us-east-1a" -type Captcha string // Always "captcha" -type CaptchaSolveResult string // Always "captcha_solve_result" -type CdpConnect string // Always "cdp_connect" -type CdpDisconnect string // Always "cdp_disconnect" -type Connection string // Always "connection" -type Console string // Always "console" -type ConsoleError string // Always "console_error" -type ConsoleLog string // Always "console_log" -type Control string // Always "control" -type DeploymentState string // Always "deployment_state" -type Error string // Always "error" -type Interaction string // Always "interaction" -type InteractionClick string // Always "interaction_click" -type InteractionKey string // Always "interaction_key" -type InteractionScrollSettled string // Always "interaction_scroll_settled" -type InvocationState string // Always "invocation_state" -type LiveViewConnect string // Always "live_view_connect" -type LiveViewDisconnect string // Always "live_view_disconnect" -type Log string // Always "log" -type ManagedAuthState string // Always "managed_auth_state" -type Monitor string // Always "monitor" -type MonitorDisconnected string // Always "monitor_disconnected" -type MonitorInitFailed string // Always "monitor_init_failed" -type MonitorReconnectFailed string // Always "monitor_reconnect_failed" -type MonitorReconnected string // Always "monitor_reconnected" -type MonitorScreenshot string // Always "monitor_screenshot" -type Network string // Always "network" -type NetworkIdle string // Always "network_idle" -type NetworkLoadingFailed string // Always "network_loading_failed" -type NetworkRequest string // Always "network_request" -type NetworkResponse string // Always "network_response" -type Page string // Always "page" -type PageDomContentLoaded string // Always "page_dom_content_loaded" -type PageLayoutSettled string // Always "page_layout_settled" -type PageLayoutShift string // Always "page_layout_shift" -type PageLcp string // Always "page_lcp" -type PageLoad string // Always "page_load" -type PageNavigation string // Always "page_navigation" -type PageNavigationSettled string // Always "page_navigation_settled" -type PageTabOpened string // Always "page_tab_opened" -type ProxyError string // Always "proxy_error" -type Screenshot string // Always "screenshot" -type ServiceCrashed string // Always "service_crashed" -type SseHeartbeat string // Always "sse_heartbeat" -type System string // Always "system" -type SystemOomKill string // Always "system_oom_kill" +type APICall string // Always "api_call" +type AppVersionSummary string // Always "app_version_summary" +type AutofillTrigger string // Always "Autofill.trigger" +type AwsUsEast1a string // Always "aws.us-east-1a" +type BrowserCancelDownload string // Always "Browser.cancelDownload" +type BrowserClose string // Always "Browser.close" +type BrowserSetContentsSize string // Always "Browser.setContentsSize" +type BrowserSetWindowBounds string // Always "Browser.setWindowBounds" +type Captcha string // Always "captcha" +type CaptchaSolveResult string // Always "captcha_solve_result" +type CdpCommand string // Always "cdp_command" +type CdpConnect string // Always "cdp_connect" +type CdpDisconnect string // Always "cdp_disconnect" +type Connection string // Always "connection" +type Console string // Always "console" +type ConsoleError string // Always "console_error" +type ConsoleLog string // Always "console_log" +type Control string // Always "control" +type DeploymentState string // Always "deployment_state" +type DomFocus string // Always "DOM.focus" +type DomScrollIntoViewIfNeeded string // Always "DOM.scrollIntoViewIfNeeded" +type DomSetFileInputFiles string // Always "DOM.setFileInputFiles" +type Error string // Always "error" +type InputCancelDragging string // Always "Input.cancelDragging" +type InputDispatchDragEvent string // Always "Input.dispatchDragEvent" +type InputDispatchKeyEvent string // Always "Input.dispatchKeyEvent" +type InputDispatchMouseEvent string // Always "Input.dispatchMouseEvent" +type InputDispatchTouchEvent string // Always "Input.dispatchTouchEvent" +type InputEmulateTouchFromMouseEvent string // Always "Input.emulateTouchFromMouseEvent" +type InputImeSetComposition string // Always "Input.imeSetComposition" +type InputInsertText string // Always "Input.insertText" +type InputSynthesizePinchGesture string // Always "Input.synthesizePinchGesture" +type InputSynthesizeScrollGesture string // Always "Input.synthesizeScrollGesture" +type InputSynthesizeTapGesture string // Always "Input.synthesizeTapGesture" +type Interaction string // Always "interaction" +type InteractionClick string // Always "interaction_click" +type InteractionKey string // Always "interaction_key" +type InteractionScrollSettled string // Always "interaction_scroll_settled" +type InvocationState string // Always "invocation_state" +type LiveViewConnect string // Always "live_view_connect" +type LiveViewDisconnect string // Always "live_view_disconnect" +type Log string // Always "log" +type ManagedAuthState string // Always "managed_auth_state" +type Monitor string // Always "monitor" +type MonitorDisconnected string // Always "monitor_disconnected" +type MonitorInitFailed string // Always "monitor_init_failed" +type MonitorReconnectFailed string // Always "monitor_reconnect_failed" +type MonitorReconnected string // Always "monitor_reconnected" +type MonitorScreenshot string // Always "monitor_screenshot" +type Network string // Always "network" +type NetworkIdle string // Always "network_idle" +type NetworkLoadingFailed string // Always "network_loading_failed" +type NetworkRequest string // Always "network_request" +type NetworkResponse string // Always "network_response" +type Page string // Always "page" +type PageCrashed string // Always "page_crashed" +type PageDomContentLoaded string // Always "page_dom_content_loaded" +type PageLayoutSettled string // Always "page_layout_settled" +type PageLayoutShift string // Always "page_layout_shift" +type PageLcp string // Always "page_lcp" +type PageLoad string // Always "page_load" +type PageNavigation string // Always "page_navigation" +type PageNavigationSettled string // Always "page_navigation_settled" +type PageTabOpened string // Always "page_tab_opened" +type PageBringToFront string // Always "Page.bringToFront" +type PageCaptureScreenshot string // Always "Page.captureScreenshot" +type PageCaptureSnapshot string // Always "Page.captureSnapshot" +type PageClose string // Always "Page.close" +type PageHandleJavaScriptDialog string // Always "Page.handleJavaScriptDialog" +type PageNavigate string // Always "Page.navigate" +type PageNavigateToHistoryEntry string // Always "Page.navigateToHistoryEntry" +type PagePrintToPdf string // Always "Page.printToPDF" +type PageReload string // Always "Page.reload" +type PageSetWebLifecycleState string // Always "Page.setWebLifecycleState" +type PageStartScreencast string // Always "Page.startScreencast" +type PageStopLoading string // Always "Page.stopLoading" +type PageStopScreencast string // Always "Page.stopScreencast" +type Platform string // Always "platform" +type PlatformAPICall string // Always "platform_api_call" +type ProxyError string // Always "proxy_error" +type Screenshot string // Always "screenshot" +type ServiceCrashed string // Always "service_crashed" +type SseHeartbeat string // Always "sse_heartbeat" +type System string // Always "system" +type SystemOomKill string // Always "system_oom_kill" +type TargetActivateTarget string // Always "Target.activateTarget" +type TargetCloseTarget string // Always "Target.closeTarget" +type TargetCreateBrowserContext string // Always "Target.createBrowserContext" +type TargetCreateTarget string // Always "Target.createTarget" +type TargetDisposeBrowserContext string // Always "Target.disposeBrowserContext" +type TargetOpenDevTools string // Always "Target.openDevTools" -func (c APICall) Default() APICall { return "api_call" } -func (c AppVersionSummary) Default() AppVersionSummary { return "app_version_summary" } -func (c AwsUsEast1a) Default() AwsUsEast1a { return "aws.us-east-1a" } -func (c Captcha) Default() Captcha { return "captcha" } -func (c CaptchaSolveResult) Default() CaptchaSolveResult { return "captcha_solve_result" } -func (c CdpConnect) Default() CdpConnect { return "cdp_connect" } -func (c CdpDisconnect) Default() CdpDisconnect { return "cdp_disconnect" } -func (c Connection) Default() Connection { return "connection" } -func (c Console) Default() Console { return "console" } -func (c ConsoleError) Default() ConsoleError { return "console_error" } -func (c ConsoleLog) Default() ConsoleLog { return "console_log" } -func (c Control) Default() Control { return "control" } -func (c DeploymentState) Default() DeploymentState { return "deployment_state" } -func (c Error) Default() Error { return "error" } -func (c Interaction) Default() Interaction { return "interaction" } -func (c InteractionClick) Default() InteractionClick { return "interaction_click" } -func (c InteractionKey) Default() InteractionKey { return "interaction_key" } +func (c APICall) Default() APICall { return "api_call" } +func (c AppVersionSummary) Default() AppVersionSummary { return "app_version_summary" } +func (c AutofillTrigger) Default() AutofillTrigger { return "Autofill.trigger" } +func (c AwsUsEast1a) Default() AwsUsEast1a { return "aws.us-east-1a" } +func (c BrowserCancelDownload) Default() BrowserCancelDownload { return "Browser.cancelDownload" } +func (c BrowserClose) Default() BrowserClose { return "Browser.close" } +func (c BrowserSetContentsSize) Default() BrowserSetContentsSize { return "Browser.setContentsSize" } +func (c BrowserSetWindowBounds) Default() BrowserSetWindowBounds { return "Browser.setWindowBounds" } +func (c Captcha) Default() Captcha { return "captcha" } +func (c CaptchaSolveResult) Default() CaptchaSolveResult { return "captcha_solve_result" } +func (c CdpCommand) Default() CdpCommand { return "cdp_command" } +func (c CdpConnect) Default() CdpConnect { return "cdp_connect" } +func (c CdpDisconnect) Default() CdpDisconnect { return "cdp_disconnect" } +func (c Connection) Default() Connection { return "connection" } +func (c Console) Default() Console { return "console" } +func (c ConsoleError) Default() ConsoleError { return "console_error" } +func (c ConsoleLog) Default() ConsoleLog { return "console_log" } +func (c Control) Default() Control { return "control" } +func (c DeploymentState) Default() DeploymentState { return "deployment_state" } +func (c DomFocus) Default() DomFocus { return "DOM.focus" } +func (c DomScrollIntoViewIfNeeded) Default() DomScrollIntoViewIfNeeded { + return "DOM.scrollIntoViewIfNeeded" +} +func (c DomSetFileInputFiles) Default() DomSetFileInputFiles { return "DOM.setFileInputFiles" } +func (c Error) Default() Error { return "error" } +func (c InputCancelDragging) Default() InputCancelDragging { return "Input.cancelDragging" } +func (c InputDispatchDragEvent) Default() InputDispatchDragEvent { return "Input.dispatchDragEvent" } +func (c InputDispatchKeyEvent) Default() InputDispatchKeyEvent { return "Input.dispatchKeyEvent" } +func (c InputDispatchMouseEvent) Default() InputDispatchMouseEvent { return "Input.dispatchMouseEvent" } +func (c InputDispatchTouchEvent) Default() InputDispatchTouchEvent { return "Input.dispatchTouchEvent" } +func (c InputEmulateTouchFromMouseEvent) Default() InputEmulateTouchFromMouseEvent { + return "Input.emulateTouchFromMouseEvent" +} +func (c InputImeSetComposition) Default() InputImeSetComposition { return "Input.imeSetComposition" } +func (c InputInsertText) Default() InputInsertText { return "Input.insertText" } +func (c InputSynthesizePinchGesture) Default() InputSynthesizePinchGesture { + return "Input.synthesizePinchGesture" +} +func (c InputSynthesizeScrollGesture) Default() InputSynthesizeScrollGesture { + return "Input.synthesizeScrollGesture" +} +func (c InputSynthesizeTapGesture) Default() InputSynthesizeTapGesture { + return "Input.synthesizeTapGesture" +} +func (c Interaction) Default() Interaction { return "interaction" } +func (c InteractionClick) Default() InteractionClick { return "interaction_click" } +func (c InteractionKey) Default() InteractionKey { return "interaction_key" } func (c InteractionScrollSettled) Default() InteractionScrollSettled { return "interaction_scroll_settled" } @@ -105,6 +177,7 @@ func (c NetworkLoadingFailed) Default() NetworkLoadingFailed { return "netwo func (c NetworkRequest) Default() NetworkRequest { return "network_request" } func (c NetworkResponse) Default() NetworkResponse { return "network_response" } func (c Page) Default() Page { return "page" } +func (c PageCrashed) Default() PageCrashed { return "page_crashed" } func (c PageDomContentLoaded) Default() PageDomContentLoaded { return "page_dom_content_loaded" } func (c PageLayoutSettled) Default() PageLayoutSettled { return "page_layout_settled" } func (c PageLayoutShift) Default() PageLayoutShift { return "page_layout_shift" } @@ -113,62 +186,135 @@ func (c PageLoad) Default() PageLoad { return "page_ func (c PageNavigation) Default() PageNavigation { return "page_navigation" } func (c PageNavigationSettled) Default() PageNavigationSettled { return "page_navigation_settled" } func (c PageTabOpened) Default() PageTabOpened { return "page_tab_opened" } -func (c ProxyError) Default() ProxyError { return "proxy_error" } -func (c Screenshot) Default() Screenshot { return "screenshot" } -func (c ServiceCrashed) Default() ServiceCrashed { return "service_crashed" } -func (c SseHeartbeat) Default() SseHeartbeat { return "sse_heartbeat" } -func (c System) Default() System { return "system" } -func (c SystemOomKill) Default() SystemOomKill { return "system_oom_kill" } +func (c PageBringToFront) Default() PageBringToFront { return "Page.bringToFront" } +func (c PageCaptureScreenshot) Default() PageCaptureScreenshot { return "Page.captureScreenshot" } +func (c PageCaptureSnapshot) Default() PageCaptureSnapshot { return "Page.captureSnapshot" } +func (c PageClose) Default() PageClose { return "Page.close" } +func (c PageHandleJavaScriptDialog) Default() PageHandleJavaScriptDialog { + return "Page.handleJavaScriptDialog" +} +func (c PageNavigate) Default() PageNavigate { return "Page.navigate" } +func (c PageNavigateToHistoryEntry) Default() PageNavigateToHistoryEntry { + return "Page.navigateToHistoryEntry" +} +func (c PagePrintToPdf) Default() PagePrintToPdf { return "Page.printToPDF" } +func (c PageReload) Default() PageReload { return "Page.reload" } +func (c PageSetWebLifecycleState) Default() PageSetWebLifecycleState { + return "Page.setWebLifecycleState" +} +func (c PageStartScreencast) Default() PageStartScreencast { return "Page.startScreencast" } +func (c PageStopLoading) Default() PageStopLoading { return "Page.stopLoading" } +func (c PageStopScreencast) Default() PageStopScreencast { return "Page.stopScreencast" } +func (c Platform) Default() Platform { return "platform" } +func (c PlatformAPICall) Default() PlatformAPICall { return "platform_api_call" } +func (c ProxyError) Default() ProxyError { return "proxy_error" } +func (c Screenshot) Default() Screenshot { return "screenshot" } +func (c ServiceCrashed) Default() ServiceCrashed { return "service_crashed" } +func (c SseHeartbeat) Default() SseHeartbeat { return "sse_heartbeat" } +func (c System) Default() System { return "system" } +func (c SystemOomKill) Default() SystemOomKill { return "system_oom_kill" } +func (c TargetActivateTarget) Default() TargetActivateTarget { return "Target.activateTarget" } +func (c TargetCloseTarget) Default() TargetCloseTarget { return "Target.closeTarget" } +func (c TargetCreateBrowserContext) Default() TargetCreateBrowserContext { + return "Target.createBrowserContext" +} +func (c TargetCreateTarget) Default() TargetCreateTarget { return "Target.createTarget" } +func (c TargetDisposeBrowserContext) Default() TargetDisposeBrowserContext { + return "Target.disposeBrowserContext" +} +func (c TargetOpenDevTools) Default() TargetOpenDevTools { return "Target.openDevTools" } -func (c APICall) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c AppVersionSummary) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c AwsUsEast1a) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c Captcha) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c CaptchaSolveResult) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c CdpConnect) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c CdpDisconnect) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c Connection) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c Console) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c ConsoleError) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c ConsoleLog) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c Control) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c DeploymentState) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c Error) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c Interaction) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c InteractionClick) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c InteractionKey) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c InteractionScrollSettled) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c InvocationState) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c LiveViewConnect) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c LiveViewDisconnect) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c Log) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c ManagedAuthState) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c Monitor) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c MonitorDisconnected) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c MonitorInitFailed) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c MonitorReconnectFailed) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c MonitorReconnected) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c MonitorScreenshot) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c Network) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c NetworkIdle) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c NetworkLoadingFailed) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c NetworkRequest) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c NetworkResponse) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c Page) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c PageDomContentLoaded) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c PageLayoutSettled) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c PageLayoutShift) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c PageLcp) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c PageLoad) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c PageNavigation) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c PageNavigationSettled) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c PageTabOpened) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c ProxyError) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c Screenshot) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c ServiceCrashed) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c SseHeartbeat) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c System) MarshalJSON() ([]byte, error) { return marshalString(c) } -func (c SystemOomKill) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c APICall) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c AppVersionSummary) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c AutofillTrigger) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c AwsUsEast1a) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c BrowserCancelDownload) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c BrowserClose) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c BrowserSetContentsSize) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c BrowserSetWindowBounds) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Captcha) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c CaptchaSolveResult) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c CdpCommand) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c CdpConnect) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c CdpDisconnect) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Connection) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Console) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c ConsoleError) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c ConsoleLog) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Control) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c DeploymentState) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c DomFocus) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c DomScrollIntoViewIfNeeded) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c DomSetFileInputFiles) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Error) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InputCancelDragging) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InputDispatchDragEvent) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InputDispatchKeyEvent) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InputDispatchMouseEvent) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InputDispatchTouchEvent) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InputEmulateTouchFromMouseEvent) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InputImeSetComposition) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InputInsertText) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InputSynthesizePinchGesture) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InputSynthesizeScrollGesture) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InputSynthesizeTapGesture) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Interaction) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InteractionClick) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InteractionKey) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InteractionScrollSettled) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c InvocationState) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c LiveViewConnect) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c LiveViewDisconnect) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Log) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c ManagedAuthState) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Monitor) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c MonitorDisconnected) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c MonitorInitFailed) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c MonitorReconnectFailed) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c MonitorReconnected) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c MonitorScreenshot) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Network) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c NetworkIdle) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c NetworkLoadingFailed) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c NetworkRequest) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c NetworkResponse) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Page) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageCrashed) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageDomContentLoaded) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageLayoutSettled) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageLayoutShift) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageLcp) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageLoad) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageNavigation) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageNavigationSettled) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageTabOpened) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageBringToFront) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageCaptureScreenshot) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageCaptureSnapshot) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageClose) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageHandleJavaScriptDialog) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageNavigate) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageNavigateToHistoryEntry) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PagePrintToPdf) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageReload) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageSetWebLifecycleState) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageStartScreencast) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageStopLoading) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PageStopScreencast) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Platform) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c PlatformAPICall) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c ProxyError) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Screenshot) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c ServiceCrashed) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c SseHeartbeat) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c System) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c SystemOomKill) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c TargetActivateTarget) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c TargetCloseTarget) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c TargetCreateBrowserContext) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c TargetCreateTarget) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c TargetDisposeBrowserContext) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c TargetOpenDevTools) MarshalJSON() ([]byte, error) { return marshalString(c) } type constant[T any] interface { Constant[T] From ed906a4e44768e057d03deb5c0b9928fa406a798 Mon Sep 17 00:00:00 2001 From: "kernel-internal[bot]" <260533166+kernel-internal[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2026 17:38:02 +0000 Subject: [PATCH 2/2] release: 0.94.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ README.md | 2 +- internal/version.go | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c486f6d..91393ed 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.93.0" + ".": "0.94.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a4b9b3..c01a132 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.94.0](https://github.com/kernel/kernel-go-sdk/compare/v0.93.0...v0.94.0) (2026-08-21) + + +### Features + +* Mirror the control/platform telemetry split into the public API ([57f9583](https://github.com/kernel/kernel-go-sdk/commit/57f9583e4d57a63513f400599936e891d66e1880)) + ## [0.93.0](https://github.com/kernel/kernel-go-sdk/compare/v0.92.0...v0.93.0) (2026-08-19) diff --git a/README.md b/README.md index 9d3fe38..aaec74b 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Or to pin the version: ```sh -go get -u 'github.com/kernel/kernel-go-sdk@v0.93.0' +go get -u 'github.com/kernel/kernel-go-sdk@v0.94.0' ``` diff --git a/internal/version.go b/internal/version.go index 6cb9969..f90f9cd 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.93.0" // x-release-please-version +const PackageVersion = "0.94.0" // x-release-please-version