diff --git a/lib/Commands.ml b/lib/Commands.ml index d877740..e18a891 100644 --- a/lib/Commands.ml +++ b/lib/Commands.ml @@ -27206,11 +27206,25 @@ iframes, shadow DOM, external resources, and element-inline styles. |desc}] "Whether or not universal access should be granted to the \ isolated world. This is a powerful\n\ option, use with caution."] + contentSecurityPolicy : string option; + [@key "contentSecurityPolicy"] + [@yojson.option] + [@ocaml.doc + "An optional content security policy to set for the isolated \ + world.\n\ + If omitted, any existing CSP for the world will be cleared.\n\ + Note that clearing or updating the CSP does not immediately \ + affect the active\n\ + context in the same document because LocalDOMWindow caches the\n\ + ContentSecurityPolicy object. The change takes effect on \ + subsequent\n\ + navigations when a new window context is created."] } [@@deriving yojson] - let make ~frameId ?worldName ?grantUniveralAccess () = - { frameId; worldName; grantUniveralAccess } + let make ~frameId ?worldName ?grantUniveralAccess ?contentSecurityPolicy + () = + { frameId; worldName; grantUniveralAccess; contentSecurityPolicy } end module Request = struct @@ -35619,19 +35633,18 @@ one. |desc}] [@key "focus"] [@yojson.option] [@ocaml.doc - "If specified, the option is used to determine if the new target \ - should\n\ - be focused or not. By default, the focus behavior depends on the\n\ - value of the background field. For example, background=false \ - and focus=false\n\ - will result in the target tab being opened but the browser \ - window remain\n\ - unchanged (if it was in the background, it will remain in the \ - background)\n\ - and background=false with focus=undefined will result in the \ - window being focused.\n\ - Using background: true and focus: true is not supported and \ - will result in an error."] + "If specified, determines whether the new target should be \ + focused.\n\ + By default, the focus behavior depends on the `background` \ + parameter:\n\ + - If `background` is false (default) and `focus` is omitted, \ + the new target is focused and the browser window is brought to \ + the foreground.\n\ + - If `background` is false and `focus` is false, the target is \ + opened but the browser window's focus remains unchanged (e.g., \ + if the window was in the background, it stays there).\n\ + - If `background` is true, setting `focus` to true is not \ + supported and will result in an error."] } [@@deriving yojson] @@ -36895,12 +36908,35 @@ module Tracing = struct [@key "tracingBackend"] [@yojson.option] [@ocaml.doc "Backend type (defaults to `auto`)"] + screenshotMaxSize : Types.number option; + [@key "screenshotMaxSize"] + [@yojson.option] + [@ocaml.doc + "Maximum width and height (in pixels) of each captured screenshot.\n\ + Only used when the `disabled-by-default-devtools.screenshot` \ + category is\n\ + enabled. Defaults to 500. The combined memory footprint of \ + screenshots\n\ + (`screenshotMaxSize` * `screenshotMaxSize` * 4 * \ + `screenshotMaxCount`)\n\ + is clamped to the existing per-session budget."] + screenshotMaxCount : Types.number option; + [@key "screenshotMaxCount"] + [@yojson.option] + [@ocaml.doc + "Maximum number of screenshots captured during a single tracing \ + session.\n\ + Only used when the `disabled-by-default-devtools.screenshot` \ + category is\n\ + enabled. Defaults to 450. Clamped together with \ + `screenshotMaxSize` to\n\ + stay within the per-session screenshot memory budget."] } [@@deriving yojson] let make ?categories ?options ?bufferUsageReportingInterval ?transferMode ?streamFormat ?streamCompression ?traceConfig ?perfettoConfig - ?tracingBackend () = + ?tracingBackend ?screenshotMaxSize ?screenshotMaxCount () = { categories; options; @@ -36911,6 +36947,8 @@ module Tracing = struct traceConfig; perfettoConfig; tracingBackend; + screenshotMaxSize; + screenshotMaxCount; } end diff --git a/lib/Types.ml b/lib/Types.ml index 8847a19..857233a 100644 --- a/lib/Types.ml +++ b/lib/Types.ml @@ -1098,7 +1098,27 @@ end = struct end and Ads : sig - module rec AdMetrics : sig + module rec AdFrameData : sig + type t = { + frameId : Page.FrameId.t; + [@key "frameId"] [@ocaml.doc "The DevTools frame token."] + initialOrigin : string option; + [@key "initialOrigin"] + [@yojson.option] + [@ocaml.doc + "The initial origin of the frame. To minimize the payload size, \ + this is\n\ + only sent once per frame."] + networkBytes : number; + [@key "networkBytes"] [@ocaml.doc "The network bytes of the frame."] + cpuTime : number; + [@key "cpuTime"] + [@ocaml.doc "The CPU time of the frame, in milliseconds."] + } + [@@deriving yojson] [@@ocaml.doc "Ad frame data."] + end + + and AdMetrics : sig type t = { viewportAdDensityByArea : number; [@key "viewportAdDensityByArea"] @@ -1128,11 +1148,58 @@ and Ads : sig totalAdNetworkBytes : number; [@key "totalAdNetworkBytes"] [@ocaml.doc "The total ad network bytes."] + updateAdFrames : AdFrameData.t list; + [@key "updateAdFrames"] + [@ocaml.doc + "The list of ad frames that have been updated since the last event."] + removeAdFrames : Page.FrameId.t list; + [@key "removeAdFrames"] + [@ocaml.doc + "The list of ad frame IDs that have been removed since the last \ + event."] } [@@deriving yojson] [@@ocaml.doc "Ad metrics for a page."] end end = struct - module rec AdMetrics : sig + module rec AdFrameData : sig + type t = { + frameId : Page.FrameId.t; + [@key "frameId"] [@ocaml.doc "The DevTools frame token."] + initialOrigin : string option; + [@key "initialOrigin"] + [@yojson.option] + [@ocaml.doc + "The initial origin of the frame. To minimize the payload size, \ + this is\n\ + only sent once per frame."] + networkBytes : number; + [@key "networkBytes"] [@ocaml.doc "The network bytes of the frame."] + cpuTime : number; + [@key "cpuTime"] + [@ocaml.doc "The CPU time of the frame, in milliseconds."] + } + [@@deriving yojson] [@@ocaml.doc "Ad frame data."] + end = struct + type t = { + frameId : Page.FrameId.t; + [@key "frameId"] [@ocaml.doc "The DevTools frame token."] + initialOrigin : string option; + [@key "initialOrigin"] + [@yojson.option] + [@ocaml.doc + "The initial origin of the frame. To minimize the payload size, \ + this is\n\ + only sent once per frame."] + networkBytes : number; + [@key "networkBytes"] [@ocaml.doc "The network bytes of the frame."] + cpuTime : number; + [@key "cpuTime"] + [@ocaml.doc "The CPU time of the frame, in milliseconds."] + } + [@@deriving yojson] [@@ocaml.doc "Ad frame data."] + end + + and AdMetrics : sig type t = { viewportAdDensityByArea : number; [@key "viewportAdDensityByArea"] @@ -1162,6 +1229,15 @@ end = struct totalAdNetworkBytes : number; [@key "totalAdNetworkBytes"] [@ocaml.doc "The total ad network bytes."] + updateAdFrames : AdFrameData.t list; + [@key "updateAdFrames"] + [@ocaml.doc + "The list of ad frames that have been updated since the last event."] + removeAdFrames : Page.FrameId.t list; + [@key "removeAdFrames"] + [@ocaml.doc + "The list of ad frame IDs that have been removed since the last \ + event."] } [@@deriving yojson] [@@ocaml.doc "Ad metrics for a page."] end = struct @@ -1194,6 +1270,15 @@ end = struct totalAdNetworkBytes : number; [@key "totalAdNetworkBytes"] [@ocaml.doc "The total ad network bytes."] + updateAdFrames : AdFrameData.t list; + [@key "updateAdFrames"] + [@ocaml.doc + "The list of ad frames that have been updated since the last event."] + removeAdFrames : Page.FrameId.t list; + [@key "removeAdFrames"] + [@ocaml.doc + "The list of ad frame IDs that have been removed since the last \ + event."] } [@@deriving yojson] [@@ocaml.doc "Ad metrics for a page."] end @@ -12428,8 +12513,10 @@ and DOM : sig | `file_selector_button | `details_content | `picker + | `select_listbox | `permission_icon | `overscroll_area_parent + | `overscroll_backdrop | `skeleton ] val _pseudotype_of_yojson : Yojson.Basic.t -> _pseudotype @@ -12812,8 +12899,10 @@ end = struct | `file_selector_button | `details_content | `picker + | `select_listbox | `permission_icon | `overscroll_area_parent + | `overscroll_backdrop | `skeleton ] val _pseudotype_of_yojson : Yojson.Basic.t -> _pseudotype @@ -12862,8 +12951,10 @@ end = struct | `file_selector_button | `details_content | `picker + | `select_listbox | `permission_icon | `overscroll_area_parent + | `overscroll_backdrop | `skeleton ] let _pseudotype_of_yojson = function @@ -12907,8 +12998,10 @@ end = struct | `String "file-selector-button" -> `file_selector_button | `String "details-content" -> `details_content | `String "picker" -> `picker + | `String "select-listbox" -> `select_listbox | `String "permission-icon" -> `permission_icon | `String "overscroll-area-parent" -> `overscroll_area_parent + | `String "overscroll-backdrop" -> `overscroll_backdrop | `String "skeleton" -> `skeleton | `String s -> failwith ("unknown enum: " ^ s) | _ -> failwith "unknown enum type" @@ -12954,8 +13047,10 @@ end = struct | `file_selector_button -> `String "file-selector-button" | `details_content -> `String "details-content" | `picker -> `String "picker" + | `select_listbox -> `String "select-listbox" | `permission_icon -> `String "permission-icon" | `overscroll_area_parent -> `String "overscroll-area-parent" + | `overscroll_backdrop -> `String "overscroll-backdrop" | `skeleton -> `String "skeleton" type t = _pseudotype diff --git a/package.json b/package.json index a0c29ee..42ee7af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cdp", - "version": "0.0.1651496", + "version": "0.0.1652909", "description": "Chrome Devtools Protocol Types for OCaml", "license": "MIT", "repository": {