Documentation ¶
Overview ¶
Package fixup modifies/alters/fixes and adds to the low level type definitions for the Chrome DevTools Protocol domains, as generated from protocol.json.
The goal of package fixup is to fix the issues associated with generating Go code from the existing Chrome domain definitions, and is wrapped up in one high-level func, FixDomains.
Currently, FixDomains does the following:
- add `Inspector.DetachReason` type and change `Inspector.detached.reason` type to `Inspector.DetachReason`.
- change `Network.TimeSinceEpoch`, `Network.MonotonicTime`, and `Runtime.Timestamp` types to `TimestampTypeSecond` and `TimestampTypeMonotonic`.
- convert all object properties and event/command parameters that are enums into separate types.
- change any object property named `modifiers` to type `Input.Modifier`.
- add `DOM.NodeType` type and set any parameter named `nodeType`'s type to `DOM.NodeType`.
- change `Page.Frame.{id,parentID}` properties to `FrameID` type.
- add additional properties to `Page.Frame` and `DOM.Node` for use by higher level packages.
- add special unmarshaler to `Page.{NodeId,BackendNodeId,FrameId}` types to handle unquoted values from older (v1.1) protocol versions. NOTE: it may be necessary in the future to apply this to more types, such as `Network.LoaderId`.
- rename `Input.GestureSourceType` to `Input.GestureType`.
- fix type/name stuttering by stripping the package name from any type where the package name is a prefix (ie, `CSS` domain).
- add Error() method to `Runtime.ExceptionDetails` so that it can be used as error.
- change `Network.Headers` type to map[string]interface{}.
Please note that the above is not an exhaustive list of all modifications applied to the domains, however it does attempt to give a comprehensive overview of the most important changes to the definition vs the vanilla specification.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixDomains ¶
FixDomains modifies, updates, alters, fixes, and adds to the types defined in the domains, so that the generated Chrome DevTools Protocol domain code is more Go-like and easier to use.
Please see package-level documentation for the list of changes made to the various domains.
Types ¶
This section is empty.