Update chromedp to fix console errors (#1521)

This commit is contained in:
peolic
2021-06-23 01:05:58 +03:00
committed by GitHub
parent ae3400a9b1
commit be2fe1de26
526 changed files with 55061 additions and 30300 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -32,12 +32,13 @@ type EventEventSourceMessageReceived struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-loadingFailed
type EventLoadingFailed struct {
RequestID RequestID `json:"requestId"` // Request identifier.
Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp.
Type ResourceType `json:"type"` // Resource type.
ErrorText string `json:"errorText"` // User friendly error message.
Canceled bool `json:"canceled,omitempty"` // True if loading was canceled.
BlockedReason BlockedReason `json:"blockedReason,omitempty"` // The reason why loading was blocked, if any.
RequestID RequestID `json:"requestId"` // Request identifier.
Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp.
Type ResourceType `json:"type"` // Resource type.
ErrorText string `json:"errorText"` // User friendly error message.
Canceled bool `json:"canceled,omitempty"` // True if loading was canceled.
BlockedReason BlockedReason `json:"blockedReason,omitempty"` // The reason why loading was blocked, if any.
CorsErrorStatus *CorsErrorStatus `json:"corsErrorStatus,omitempty"` // The reason why loading was blocked by CORS, if any.
}
// EventLoadingFinished fired when HTTP request has finished loading.
@@ -170,6 +171,33 @@ type EventWebSocketWillSendHandshakeRequest struct {
Request *WebSocketRequest `json:"request"` // WebSocket request data.
}
// EventWebTransportCreated fired upon WebTransport creation.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-webTransportCreated
type EventWebTransportCreated struct {
TransportID RequestID `json:"transportId"` // WebTransport identifier.
URL string `json:"url"` // WebTransport request URL.
Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp.
Initiator *Initiator `json:"initiator,omitempty"` // Request initiator.
}
// EventWebTransportConnectionEstablished fired when WebTransport handshake
// is finished.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-webTransportConnectionEstablished
type EventWebTransportConnectionEstablished struct {
TransportID RequestID `json:"transportId"` // WebTransport identifier.
Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp.
}
// EventWebTransportClosed fired when WebTransport is disposed.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-webTransportClosed
type EventWebTransportClosed struct {
TransportID RequestID `json:"transportId"` // WebTransport identifier.
Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp.
}
// EventRequestWillBeSentExtraInfo fired when additional information about a
// requestWillBeSent event is available from the network stack. Not every
// requestWillBeSent event will have an additional requestWillBeSentExtraInfo
@@ -178,9 +206,10 @@ type EventWebSocketWillSendHandshakeRequest struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-requestWillBeSentExtraInfo
type EventRequestWillBeSentExtraInfo struct {
RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to an existing requestWillBeSent event.
AssociatedCookies []*BlockedCookieWithReason `json:"associatedCookies"` // A list of cookies potentially associated to the requested URL. This includes both cookies sent with the request and the ones not sent; the latter are distinguished by having blockedReason field set.
Headers Headers `json:"headers"` // Raw request headers as they will be sent over the wire.
RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to an existing requestWillBeSent event.
AssociatedCookies []*BlockedCookieWithReason `json:"associatedCookies"` // A list of cookies potentially associated to the requested URL. This includes both cookies sent with the request and the ones not sent; the latter are distinguished by having blockedReason field set.
Headers Headers `json:"headers"` // Raw request headers as they will be sent over the wire.
ClientSecurityState *ClientSecurityState `json:"clientSecurityState,omitempty"` // The client security state set for the request.
}
// EventResponseReceivedExtraInfo fired when additional information about a
@@ -191,8 +220,65 @@ type EventRequestWillBeSentExtraInfo struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-responseReceivedExtraInfo
type EventResponseReceivedExtraInfo struct {
RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to another responseReceived event.
BlockedCookies []*BlockedSetCookieWithReason `json:"blockedCookies"` // A list of cookies which were not stored from the response along with the corresponding reasons for blocking. The cookies here may not be valid due to syntax errors, which are represented by the invalid cookie line string instead of a proper cookie.
Headers Headers `json:"headers"` // Raw response headers as they were received over the wire.
HeadersText string `json:"headersText,omitempty"` // Raw response header text as it was received over the wire. The raw text may not always be available, such as in the case of HTTP/2 or QUIC.
RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to another responseReceived event.
BlockedCookies []*BlockedSetCookieWithReason `json:"blockedCookies"` // A list of cookies which were not stored from the response along with the corresponding reasons for blocking. The cookies here may not be valid due to syntax errors, which are represented by the invalid cookie line string instead of a proper cookie.
Headers Headers `json:"headers"` // Raw response headers as they were received over the wire.
ResourceIPAddressSpace IPAddressSpace `json:"resourceIPAddressSpace"` // The IP address space of the resource. The address space can only be determined once the transport established the connection, so we can't send it in requestWillBeSentExtraInfo.
HeadersText string `json:"headersText,omitempty"` // Raw response header text as it was received over the wire. The raw text may not always be available, such as in the case of HTTP/2 or QUIC.
}
// EventTrustTokenOperationDone fired exactly once for each Trust Token
// operation. Depending on the type of the operation and whether the operation
// succeeded or failed, the event is fired before the corresponding request was
// sent or after the response was received.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-trustTokenOperationDone
type EventTrustTokenOperationDone struct {
Status TrustTokenOperationDoneStatus `json:"status"` // Detailed success or error status of the operation. 'AlreadyExists' also signifies a successful operation, as the result of the operation already exists und thus, the operation was abort preemptively (e.g. a cache hit).
Type TrustTokenOperationType `json:"type"`
RequestID RequestID `json:"requestId"`
TopLevelOrigin string `json:"topLevelOrigin,omitempty"` // Top level origin. The context in which the operation was attempted.
IssuerOrigin string `json:"issuerOrigin,omitempty"` // Origin of the issuer in case of a "Issuance" or "Redemption" operation.
IssuedTokenCount int64 `json:"issuedTokenCount,omitempty"` // The number of obtained Trust Tokens on a successful "Issuance" operation.
}
// EventSubresourceWebBundleMetadataReceived fired once when parsing the .wbn
// file has succeeded. The event contains the information about the web bundle
// contents.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-subresourceWebBundleMetadataReceived
type EventSubresourceWebBundleMetadataReceived struct {
RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to another event.
Urls []string `json:"urls"` // A list of URLs of resources in the subresource Web Bundle.
}
// EventSubresourceWebBundleMetadataError fired once when parsing the .wbn
// file has failed.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-subresourceWebBundleMetadataError
type EventSubresourceWebBundleMetadataError struct {
RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to another event.
ErrorMessage string `json:"errorMessage"` // Error message
}
// EventSubresourceWebBundleInnerResponseParsed fired when handling requests
// for resources within a .wbn file. Note: this will only be fired for resources
// that are requested by the webpage.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-subresourceWebBundleInnerResponseParsed
type EventSubresourceWebBundleInnerResponseParsed struct {
InnerRequestID RequestID `json:"innerRequestId"` // Request identifier of the subresource request
InnerRequestURL string `json:"innerRequestURL"` // URL of the subresource resource.
BundleRequestID RequestID `json:"bundleRequestId,omitempty"` // Bundle request identifier. Used to match this information to another event. This made be absent in case when the instrumentation was enabled only after webbundle was parsed.
}
// EventSubresourceWebBundleInnerResponseError fired when request for
// resources within a .wbn file failed.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-subresourceWebBundleInnerResponseError
type EventSubresourceWebBundleInnerResponseError struct {
InnerRequestID RequestID `json:"innerRequestId"` // Request identifier of the subresource request
InnerRequestURL string `json:"innerRequestURL"` // URL of the subresource resource.
ErrorMessage string `json:"errorMessage"` // Error message
BundleRequestID RequestID `json:"bundleRequestId,omitempty"` // Bundle request identifier. Used to match this information to another event. This made be absent in case when the instrumentation was enabled only after webbundle was parsed.
}

View File

@@ -19,6 +19,47 @@ import (
"github.com/chromedp/cdproto/io"
)
// SetAcceptedEncodingsParams sets a list of content encodings that will be
// accepted. Empty list means no encoding is accepted.
type SetAcceptedEncodingsParams struct {
Encodings []ContentEncoding `json:"encodings"` // List of accepted content encodings.
}
// SetAcceptedEncodings sets a list of content encodings that will be
// accepted. Empty list means no encoding is accepted.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setAcceptedEncodings
//
// parameters:
// encodings - List of accepted content encodings.
func SetAcceptedEncodings(encodings []ContentEncoding) *SetAcceptedEncodingsParams {
return &SetAcceptedEncodingsParams{
Encodings: encodings,
}
}
// Do executes Network.setAcceptedEncodings against the provided context.
func (p *SetAcceptedEncodingsParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetAcceptedEncodings, p, nil)
}
// ClearAcceptedEncodingsOverrideParams clears accepted encodings set by
// setAcceptedEncodings.
type ClearAcceptedEncodingsOverrideParams struct{}
// ClearAcceptedEncodingsOverride clears accepted encodings set by
// setAcceptedEncodings.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-clearAcceptedEncodingsOverride
func ClearAcceptedEncodingsOverride() *ClearAcceptedEncodingsOverrideParams {
return &ClearAcceptedEncodingsOverrideParams{}
}
// Do executes Network.clearAcceptedEncodingsOverride against the provided context.
func (p *ClearAcceptedEncodingsOverrideParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandClearAcceptedEncodingsOverride, nil, nil)
}
// ClearBrowserCacheParams clears browser cache.
type ClearBrowserCacheParams struct{}
@@ -267,7 +308,7 @@ func (p *GetCertificateParams) Do(ctx context.Context) (tableNames []string, err
// Depending on the backend support, will return detailed cookie information in
// the cookies field.
type GetCookiesParams struct {
Urls []string `json:"urls,omitempty"` // The list of URLs for which applicable cookies will be fetched
Urls []string `json:"urls,omitempty"` // The list of URLs for which applicable cookies will be fetched. If not specified, it's assumed to be set to the list containing the URLs of the page and all of its subframes.
}
// GetCookies returns all browser cookies for the current URL. Depending on
@@ -281,7 +322,9 @@ func GetCookies() *GetCookiesParams {
return &GetCookiesParams{}
}
// WithUrls the list of URLs for which applicable cookies will be fetched.
// WithUrls the list of URLs for which applicable cookies will be fetched. If
// not specified, it's assumed to be set to the list containing the URLs of the
// page and all of its subframes.
func (p GetCookiesParams) WithUrls(urls []string) *GetCookiesParams {
p.Urls = urls
return &p
@@ -644,16 +687,19 @@ func (p *SetCacheDisabledParams) Do(ctx context.Context) (err error) {
// SetCookieParams sets a cookie with the given cookie data; may overwrite
// equivalent cookies if they exist.
type SetCookieParams struct {
Name string `json:"name"` // Cookie name.
Value string `json:"value"` // Cookie value.
URL string `json:"url,omitempty"` // The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie.
Domain string `json:"domain,omitempty"` // Cookie domain.
Path string `json:"path,omitempty"` // Cookie path.
Secure bool `json:"secure,omitempty"` // True if cookie is secure.
HTTPOnly bool `json:"httpOnly,omitempty"` // True if cookie is http-only.
SameSite CookieSameSite `json:"sameSite,omitempty"` // Cookie SameSite type.
Expires *cdp.TimeSinceEpoch `json:"expires,omitempty"` // Cookie expiration date, session cookie if not set
Priority CookiePriority `json:"priority,omitempty"` // Cookie Priority type.
Name string `json:"name"` // Cookie name.
Value string `json:"value"` // Cookie value.
URL string `json:"url,omitempty"` // The request-URI to associate with the setting of the cookie. This value can affect the default domain, path, source port, and source scheme values of the created cookie.
Domain string `json:"domain,omitempty"` // Cookie domain.
Path string `json:"path,omitempty"` // Cookie path.
Secure bool `json:"secure,omitempty"` // True if cookie is secure.
HTTPOnly bool `json:"httpOnly,omitempty"` // True if cookie is http-only.
SameSite CookieSameSite `json:"sameSite,omitempty"` // Cookie SameSite type.
Expires *cdp.TimeSinceEpoch `json:"expires,omitempty"` // Cookie expiration date, session cookie if not set
Priority CookiePriority `json:"priority,omitempty"` // Cookie Priority type.
SameParty bool `json:"sameParty,omitempty"` // True if cookie is SameParty.
SourceScheme CookieSourceScheme `json:"sourceScheme,omitempty"` // Cookie source scheme type.
SourcePort int64 `json:"sourcePort,omitempty"` // Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.
}
// SetCookie sets a cookie with the given cookie data; may overwrite
@@ -672,7 +718,8 @@ func SetCookie(name string, value string) *SetCookieParams {
}
// WithURL the request-URI to associate with the setting of the cookie. This
// value can affect the default domain and path values of the created cookie.
// value can affect the default domain, path, source port, and source scheme
// values of the created cookie.
func (p SetCookieParams) WithURL(url string) *SetCookieParams {
p.URL = url
return &p
@@ -720,24 +767,30 @@ func (p SetCookieParams) WithPriority(priority CookiePriority) *SetCookieParams
return &p
}
// SetCookieReturns return values.
type SetCookieReturns struct {
Success bool `json:"success,omitempty"` // True if successfully set cookie.
// WithSameParty true if cookie is SameParty.
func (p SetCookieParams) WithSameParty(sameParty bool) *SetCookieParams {
p.SameParty = sameParty
return &p
}
// WithSourceScheme cookie source scheme type.
func (p SetCookieParams) WithSourceScheme(sourceScheme CookieSourceScheme) *SetCookieParams {
p.SourceScheme = sourceScheme
return &p
}
// WithSourcePort cookie source port. Valid values are {-1, [1, 65535]}, -1
// indicates an unspecified port. An unspecified port value allows protocol
// clients to emulate legacy cookie scope for the port. This is a temporary
// ability and it will be removed in the future.
func (p SetCookieParams) WithSourcePort(sourcePort int64) *SetCookieParams {
p.SourcePort = sourcePort
return &p
}
// Do executes Network.setCookie against the provided context.
//
// returns:
// success - True if successfully set cookie.
func (p *SetCookieParams) Do(ctx context.Context) (success bool, err error) {
// execute
var res SetCookieReturns
err = cdp.Execute(ctx, CommandSetCookie, p, &res)
if err != nil {
return false, err
}
return res.Success, nil
func (p *SetCookieParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetCookie, p, nil)
}
// SetCookiesParams sets given cookies.
@@ -762,31 +815,6 @@ func (p *SetCookiesParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetCookies, p, nil)
}
// SetDataSizeLimitsForTestParams for testing.
type SetDataSizeLimitsForTestParams struct {
MaxTotalSize int64 `json:"maxTotalSize"` // Maximum total buffer size.
MaxResourceSize int64 `json:"maxResourceSize"` // Maximum per-resource size.
}
// SetDataSizeLimitsForTest for testing.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setDataSizeLimitsForTest
//
// parameters:
// maxTotalSize - Maximum total buffer size.
// maxResourceSize - Maximum per-resource size.
func SetDataSizeLimitsForTest(maxTotalSize int64, maxResourceSize int64) *SetDataSizeLimitsForTestParams {
return &SetDataSizeLimitsForTestParams{
MaxTotalSize: maxTotalSize,
MaxResourceSize: maxResourceSize,
}
}
// Do executes Network.setDataSizeLimitsForTest against the provided context.
func (p *SetDataSizeLimitsForTestParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetDataSizeLimitsForTest, p, nil)
}
// SetExtraHTTPHeadersParams specifies whether to always send extra HTTP
// headers with the requests from this page.
type SetExtraHTTPHeadersParams struct {
@@ -811,8 +839,120 @@ func (p *SetExtraHTTPHeadersParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetExtraHTTPHeaders, p, nil)
}
// SetAttachDebugStackParams specifies whether to attach a page script stack
// id in requests.
type SetAttachDebugStackParams struct {
Enabled bool `json:"enabled"` // Whether to attach a page script stack for debugging purpose.
}
// SetAttachDebugStack specifies whether to attach a page script stack id in
// requests.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setAttachDebugStack
//
// parameters:
// enabled - Whether to attach a page script stack for debugging purpose.
func SetAttachDebugStack(enabled bool) *SetAttachDebugStackParams {
return &SetAttachDebugStackParams{
Enabled: enabled,
}
}
// Do executes Network.setAttachDebugStack against the provided context.
func (p *SetAttachDebugStackParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetAttachDebugStack, p, nil)
}
// GetSecurityIsolationStatusParams returns information about the COEP/COOP
// isolation status.
type GetSecurityIsolationStatusParams struct {
FrameID cdp.FrameID `json:"frameId,omitempty"` // If no frameId is provided, the status of the target is provided.
}
// GetSecurityIsolationStatus returns information about the COEP/COOP
// isolation status.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getSecurityIsolationStatus
//
// parameters:
func GetSecurityIsolationStatus() *GetSecurityIsolationStatusParams {
return &GetSecurityIsolationStatusParams{}
}
// WithFrameID if no frameId is provided, the status of the target is
// provided.
func (p GetSecurityIsolationStatusParams) WithFrameID(frameID cdp.FrameID) *GetSecurityIsolationStatusParams {
p.FrameID = frameID
return &p
}
// GetSecurityIsolationStatusReturns return values.
type GetSecurityIsolationStatusReturns struct {
Status *SecurityIsolationStatus `json:"status,omitempty"`
}
// Do executes Network.getSecurityIsolationStatus against the provided context.
//
// returns:
// status
func (p *GetSecurityIsolationStatusParams) Do(ctx context.Context) (status *SecurityIsolationStatus, err error) {
// execute
var res GetSecurityIsolationStatusReturns
err = cdp.Execute(ctx, CommandGetSecurityIsolationStatus, p, &res)
if err != nil {
return nil, err
}
return res.Status, nil
}
// LoadNetworkResourceParams fetches the resource and returns the content.
type LoadNetworkResourceParams struct {
FrameID cdp.FrameID `json:"frameId"` // Frame id to get the resource for.
URL string `json:"url"` // URL of the resource to get content for.
Options *LoadNetworkResourceOptions `json:"options"` // Options for the request.
}
// LoadNetworkResource fetches the resource and returns the content.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-loadNetworkResource
//
// parameters:
// frameID - Frame id to get the resource for.
// url - URL of the resource to get content for.
// options - Options for the request.
func LoadNetworkResource(frameID cdp.FrameID, url string, options *LoadNetworkResourceOptions) *LoadNetworkResourceParams {
return &LoadNetworkResourceParams{
FrameID: frameID,
URL: url,
Options: options,
}
}
// LoadNetworkResourceReturns return values.
type LoadNetworkResourceReturns struct {
Resource *LoadNetworkResourcePageResult `json:"resource,omitempty"`
}
// Do executes Network.loadNetworkResource against the provided context.
//
// returns:
// resource
func (p *LoadNetworkResourceParams) Do(ctx context.Context) (resource *LoadNetworkResourcePageResult, err error) {
// execute
var res LoadNetworkResourceReturns
err = cdp.Execute(ctx, CommandLoadNetworkResource, p, &res)
if err != nil {
return nil, err
}
return res.Resource, nil
}
// Command names.
const (
CommandSetAcceptedEncodings = "Network.setAcceptedEncodings"
CommandClearAcceptedEncodingsOverride = "Network.clearAcceptedEncodingsOverride"
CommandClearBrowserCache = "Network.clearBrowserCache"
CommandClearBrowserCookies = "Network.clearBrowserCookies"
CommandDeleteCookies = "Network.deleteCookies"
@@ -833,6 +973,8 @@ const (
CommandSetCacheDisabled = "Network.setCacheDisabled"
CommandSetCookie = "Network.setCookie"
CommandSetCookies = "Network.setCookies"
CommandSetDataSizeLimitsForTest = "Network.setDataSizeLimitsForTest"
CommandSetExtraHTTPHeaders = "Network.setExtraHTTPHeaders"
CommandSetAttachDebugStack = "Network.setAttachDebugStack"
CommandGetSecurityIsolationStatus = "Network.getSecurityIsolationStatus"
CommandLoadNetworkResource = "Network.loadNetworkResource"
)

View File

@@ -6,6 +6,7 @@ import (
"errors"
"github.com/chromedp/cdproto/cdp"
"github.com/chromedp/cdproto/io"
"github.com/chromedp/cdproto/runtime"
"github.com/chromedp/cdproto/security"
"github.com/mailru/easyjson"
@@ -40,6 +41,7 @@ const (
ResourceTypeSignedExchange ResourceType = "SignedExchange"
ResourceTypePing ResourceType = "Ping"
ResourceTypeCSPViolationReport ResourceType = "CSPViolationReport"
ResourceTypePreflight ResourceType = "Preflight"
ResourceTypeOther ResourceType = "Other"
)
@@ -86,6 +88,8 @@ func (t *ResourceType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = ResourceTypePing
case ResourceTypeCSPViolationReport:
*t = ResourceTypeCSPViolationReport
case ResourceTypePreflight:
*t = ResourceTypePreflight
case ResourceTypeOther:
*t = ResourceTypeOther
@@ -366,6 +370,56 @@ func (t *CookiePriority) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CookieSourceScheme represents the source scheme of the origin that
// originally set the cookie. A value of "Unset" allows protocol clients to
// emulate legacy cookie scope for the scheme. This is a temporary ability and
// it will be removed in the future.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CookieSourceScheme
type CookieSourceScheme string
// String returns the CookieSourceScheme as string value.
func (t CookieSourceScheme) String() string {
return string(t)
}
// CookieSourceScheme values.
const (
CookieSourceSchemeUnset CookieSourceScheme = "Unset"
CookieSourceSchemeNonSecure CookieSourceScheme = "NonSecure"
CookieSourceSchemeSecure CookieSourceScheme = "Secure"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CookieSourceScheme) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t CookieSourceScheme) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CookieSourceScheme) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch CookieSourceScheme(in.String()) {
case CookieSourceSchemeUnset:
*t = CookieSourceSchemeUnset
case CookieSourceSchemeNonSecure:
*t = CookieSourceSchemeNonSecure
case CookieSourceSchemeSecure:
*t = CookieSourceSchemeSecure
default:
in.AddError(errors.New("unknown CookieSourceScheme value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *CookieSourceScheme) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// ResourceTiming timing information for the request.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-ResourceTiming
@@ -443,6 +497,13 @@ func (t *ResourcePriority) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// PostDataEntry post data entry for HTTP request.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-PostDataEntry
type PostDataEntry struct {
Bytes string `json:"bytes,omitempty"`
}
// Request HTTP request data.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-Request
@@ -453,10 +514,12 @@ type Request struct {
Headers Headers `json:"headers"` // HTTP request headers.
PostData string `json:"postData,omitempty"` // HTTP POST request data.
HasPostData bool `json:"hasPostData,omitempty"` // True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long.
PostDataEntries []*PostDataEntry `json:"postDataEntries,omitempty"` // Request body elements. This will be converted from base64 to binary
MixedContentType security.MixedContentType `json:"mixedContentType,omitempty"` // The mixed content type of the request.
InitialPriority ResourcePriority `json:"initialPriority"` // Priority of the resource request at the time request is sent.
ReferrerPolicy ReferrerPolicy `json:"referrerPolicy"` // The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/
IsLinkPreload bool `json:"isLinkPreload,omitempty"` // Whether is loaded via link preload.
TrustTokenParams *TrustTokenParams `json:"trustTokenParams,omitempty"` // Set for requests when the TrustToken API is used. Contains the parameters passed by the developer (e.g. via "fetch") as understood by the backend.
}
// SignedCertificateTimestamp details of a signed certificate timestamp
@@ -560,7 +623,6 @@ const (
BlockedReasonInspector BlockedReason = "inspector"
BlockedReasonSubresourceFilter BlockedReason = "subresource-filter"
BlockedReasonContentType BlockedReason = "content-type"
BlockedReasonCollapsedByClient BlockedReason = "collapsed-by-client"
BlockedReasonCoepFrameResourceNeedsCoepHeader BlockedReason = "coep-frame-resource-needs-coep-header"
BlockedReasonCoopSandboxedIframeCannotNavigateToCoopPage BlockedReason = "coop-sandboxed-iframe-cannot-navigate-to-coop-page"
BlockedReasonCorpNotSameOrigin BlockedReason = "corp-not-same-origin"
@@ -595,8 +657,6 @@ func (t *BlockedReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = BlockedReasonSubresourceFilter
case BlockedReasonContentType:
*t = BlockedReasonContentType
case BlockedReasonCollapsedByClient:
*t = BlockedReasonCollapsedByClient
case BlockedReasonCoepFrameResourceNeedsCoepHeader:
*t = BlockedReasonCoepFrameResourceNeedsCoepHeader
case BlockedReasonCoopSandboxedIframeCannotNavigateToCoopPage:
@@ -618,6 +678,130 @@ func (t *BlockedReason) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CorsError the reason why request was blocked.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CorsError
type CorsError string
// String returns the CorsError as string value.
func (t CorsError) String() string {
return string(t)
}
// CorsError values.
const (
CorsErrorDisallowedByMode CorsError = "DisallowedByMode"
CorsErrorInvalidResponse CorsError = "InvalidResponse"
CorsErrorWildcardOriginNotAllowed CorsError = "WildcardOriginNotAllowed"
CorsErrorMissingAllowOriginHeader CorsError = "MissingAllowOriginHeader"
CorsErrorMultipleAllowOriginValues CorsError = "MultipleAllowOriginValues"
CorsErrorInvalidAllowOriginValue CorsError = "InvalidAllowOriginValue"
CorsErrorAllowOriginMismatch CorsError = "AllowOriginMismatch"
CorsErrorInvalidAllowCredentials CorsError = "InvalidAllowCredentials"
CorsErrorCorsDisabledScheme CorsError = "CorsDisabledScheme"
CorsErrorPreflightInvalidStatus CorsError = "PreflightInvalidStatus"
CorsErrorPreflightDisallowedRedirect CorsError = "PreflightDisallowedRedirect"
CorsErrorPreflightWildcardOriginNotAllowed CorsError = "PreflightWildcardOriginNotAllowed"
CorsErrorPreflightMissingAllowOriginHeader CorsError = "PreflightMissingAllowOriginHeader"
CorsErrorPreflightMultipleAllowOriginValues CorsError = "PreflightMultipleAllowOriginValues"
CorsErrorPreflightInvalidAllowOriginValue CorsError = "PreflightInvalidAllowOriginValue"
CorsErrorPreflightAllowOriginMismatch CorsError = "PreflightAllowOriginMismatch"
CorsErrorPreflightInvalidAllowCredentials CorsError = "PreflightInvalidAllowCredentials"
CorsErrorPreflightMissingAllowExternal CorsError = "PreflightMissingAllowExternal"
CorsErrorPreflightInvalidAllowExternal CorsError = "PreflightInvalidAllowExternal"
CorsErrorInvalidAllowMethodsPreflightResponse CorsError = "InvalidAllowMethodsPreflightResponse"
CorsErrorInvalidAllowHeadersPreflightResponse CorsError = "InvalidAllowHeadersPreflightResponse"
CorsErrorMethodDisallowedByPreflightResponse CorsError = "MethodDisallowedByPreflightResponse"
CorsErrorHeaderDisallowedByPreflightResponse CorsError = "HeaderDisallowedByPreflightResponse"
CorsErrorRedirectContainsCredentials CorsError = "RedirectContainsCredentials"
CorsErrorInsecurePrivateNetwork CorsError = "InsecurePrivateNetwork"
CorsErrorNoCorsRedirectModeNotFollow CorsError = "NoCorsRedirectModeNotFollow"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CorsError) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t CorsError) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CorsError) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch CorsError(in.String()) {
case CorsErrorDisallowedByMode:
*t = CorsErrorDisallowedByMode
case CorsErrorInvalidResponse:
*t = CorsErrorInvalidResponse
case CorsErrorWildcardOriginNotAllowed:
*t = CorsErrorWildcardOriginNotAllowed
case CorsErrorMissingAllowOriginHeader:
*t = CorsErrorMissingAllowOriginHeader
case CorsErrorMultipleAllowOriginValues:
*t = CorsErrorMultipleAllowOriginValues
case CorsErrorInvalidAllowOriginValue:
*t = CorsErrorInvalidAllowOriginValue
case CorsErrorAllowOriginMismatch:
*t = CorsErrorAllowOriginMismatch
case CorsErrorInvalidAllowCredentials:
*t = CorsErrorInvalidAllowCredentials
case CorsErrorCorsDisabledScheme:
*t = CorsErrorCorsDisabledScheme
case CorsErrorPreflightInvalidStatus:
*t = CorsErrorPreflightInvalidStatus
case CorsErrorPreflightDisallowedRedirect:
*t = CorsErrorPreflightDisallowedRedirect
case CorsErrorPreflightWildcardOriginNotAllowed:
*t = CorsErrorPreflightWildcardOriginNotAllowed
case CorsErrorPreflightMissingAllowOriginHeader:
*t = CorsErrorPreflightMissingAllowOriginHeader
case CorsErrorPreflightMultipleAllowOriginValues:
*t = CorsErrorPreflightMultipleAllowOriginValues
case CorsErrorPreflightInvalidAllowOriginValue:
*t = CorsErrorPreflightInvalidAllowOriginValue
case CorsErrorPreflightAllowOriginMismatch:
*t = CorsErrorPreflightAllowOriginMismatch
case CorsErrorPreflightInvalidAllowCredentials:
*t = CorsErrorPreflightInvalidAllowCredentials
case CorsErrorPreflightMissingAllowExternal:
*t = CorsErrorPreflightMissingAllowExternal
case CorsErrorPreflightInvalidAllowExternal:
*t = CorsErrorPreflightInvalidAllowExternal
case CorsErrorInvalidAllowMethodsPreflightResponse:
*t = CorsErrorInvalidAllowMethodsPreflightResponse
case CorsErrorInvalidAllowHeadersPreflightResponse:
*t = CorsErrorInvalidAllowHeadersPreflightResponse
case CorsErrorMethodDisallowedByPreflightResponse:
*t = CorsErrorMethodDisallowedByPreflightResponse
case CorsErrorHeaderDisallowedByPreflightResponse:
*t = CorsErrorHeaderDisallowedByPreflightResponse
case CorsErrorRedirectContainsCredentials:
*t = CorsErrorRedirectContainsCredentials
case CorsErrorInsecurePrivateNetwork:
*t = CorsErrorInsecurePrivateNetwork
case CorsErrorNoCorsRedirectModeNotFollow:
*t = CorsErrorNoCorsRedirectModeNotFollow
default:
in.AddError(errors.New("unknown CorsError value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *CorsError) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CorsErrorStatus [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CorsErrorStatus
type CorsErrorStatus struct {
CorsError CorsError `json:"corsError"`
FailedParameter string `json:"failedParameter"`
}
// ServiceWorkerResponseSource source of serviceworker response.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-ServiceWorkerResponseSource
@@ -668,6 +852,64 @@ func (t *ServiceWorkerResponseSource) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// TrustTokenParams determines what type of Trust Token operation is executed
// and depending on the type, some additional parameters. The values are
// specified in third_party/blink/renderer/core/fetch/trust_token.idl.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-TrustTokenParams
type TrustTokenParams struct {
Type TrustTokenOperationType `json:"type"`
RefreshPolicy TrustTokenParamsRefreshPolicy `json:"refreshPolicy"` // Only set for "token-redemption" type and determine whether to request a fresh SRR or use a still valid cached SRR.
Issuers []string `json:"issuers,omitempty"` // Origins of issuers from whom to request tokens or redemption records.
}
// TrustTokenOperationType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-TrustTokenOperationType
type TrustTokenOperationType string
// String returns the TrustTokenOperationType as string value.
func (t TrustTokenOperationType) String() string {
return string(t)
}
// TrustTokenOperationType values.
const (
TrustTokenOperationTypeIssuance TrustTokenOperationType = "Issuance"
TrustTokenOperationTypeRedemption TrustTokenOperationType = "Redemption"
TrustTokenOperationTypeSigning TrustTokenOperationType = "Signing"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t TrustTokenOperationType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t TrustTokenOperationType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *TrustTokenOperationType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch TrustTokenOperationType(in.String()) {
case TrustTokenOperationTypeIssuance:
*t = TrustTokenOperationTypeIssuance
case TrustTokenOperationTypeRedemption:
*t = TrustTokenOperationTypeRedemption
case TrustTokenOperationTypeSigning:
*t = TrustTokenOperationTypeSigning
default:
in.AddError(errors.New("unknown TrustTokenOperationType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *TrustTokenOperationType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// Response HTTP response data.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-Response
@@ -740,27 +982,32 @@ type CachedResource struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-Initiator
type Initiator struct {
Type InitiatorType `json:"type"` // Type of this initiator.
Stack *runtime.StackTrace `json:"stack,omitempty"` // Initiator JavaScript stack trace, set for Script only.
URL string `json:"url,omitempty"` // Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.
LineNumber float64 `json:"lineNumber,omitempty"` // Initiator line number, set for Parser type or for Script type (when script is importing module) (0-based).
Type InitiatorType `json:"type"` // Type of this initiator.
Stack *runtime.StackTrace `json:"stack,omitempty"` // Initiator JavaScript stack trace, set for Script only.
URL string `json:"url,omitempty"` // Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.
LineNumber float64 `json:"lineNumber,omitempty"` // Initiator line number, set for Parser type or for Script type (when script is importing module) (0-based).
ColumnNumber float64 `json:"columnNumber,omitempty"` // Initiator column number, set for Parser type or for Script type (when script is importing module) (0-based).
RequestID RequestID `json:"requestId,omitempty"` // Set if another request triggered this request (e.g. preflight).
}
// Cookie cookie object.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-Cookie
type Cookie struct {
Name string `json:"name"` // Cookie name.
Value string `json:"value"` // Cookie value.
Domain string `json:"domain"` // Cookie domain.
Path string `json:"path"` // Cookie path.
Expires float64 `json:"expires"` // Cookie expiration date as the number of seconds since the UNIX epoch.
Size int64 `json:"size"` // Cookie size.
HTTPOnly bool `json:"httpOnly"` // True if cookie is http-only.
Secure bool `json:"secure"` // True if cookie is secure.
Session bool `json:"session"` // True in case of session cookie.
SameSite CookieSameSite `json:"sameSite,omitempty"` // Cookie SameSite type.
Priority CookiePriority `json:"priority"` // Cookie Priority
Name string `json:"name"` // Cookie name.
Value string `json:"value"` // Cookie value.
Domain string `json:"domain"` // Cookie domain.
Path string `json:"path"` // Cookie path.
Expires float64 `json:"expires"` // Cookie expiration date as the number of seconds since the UNIX epoch.
Size int64 `json:"size"` // Cookie size.
HTTPOnly bool `json:"httpOnly"` // True if cookie is http-only.
Secure bool `json:"secure"` // True if cookie is secure.
Session bool `json:"session"` // True in case of session cookie.
SameSite CookieSameSite `json:"sameSite,omitempty"` // Cookie SameSite type.
Priority CookiePriority `json:"priority"` // Cookie Priority
SameParty bool `json:"sameParty"` // True if cookie is SameParty.
SourceScheme CookieSourceScheme `json:"sourceScheme"` // Cookie source scheme type.
SourcePort int64 `json:"sourcePort"` // Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.
}
// SetCookieBlockedReason types of reasons why a cookie may not be stored
@@ -776,18 +1023,23 @@ func (t SetCookieBlockedReason) String() string {
// SetCookieBlockedReason values.
const (
SetCookieBlockedReasonSecureOnly SetCookieBlockedReason = "SecureOnly"
SetCookieBlockedReasonSameSiteStrict SetCookieBlockedReason = "SameSiteStrict"
SetCookieBlockedReasonSameSiteLax SetCookieBlockedReason = "SameSiteLax"
SetCookieBlockedReasonSameSiteUnspecifiedTreatedAsLax SetCookieBlockedReason = "SameSiteUnspecifiedTreatedAsLax"
SetCookieBlockedReasonSameSiteNoneInsecure SetCookieBlockedReason = "SameSiteNoneInsecure"
SetCookieBlockedReasonUserPreferences SetCookieBlockedReason = "UserPreferences"
SetCookieBlockedReasonSyntaxError SetCookieBlockedReason = "SyntaxError"
SetCookieBlockedReasonSchemeNotSupported SetCookieBlockedReason = "SchemeNotSupported"
SetCookieBlockedReasonOverwriteSecure SetCookieBlockedReason = "OverwriteSecure"
SetCookieBlockedReasonInvalidDomain SetCookieBlockedReason = "InvalidDomain"
SetCookieBlockedReasonInvalidPrefix SetCookieBlockedReason = "InvalidPrefix"
SetCookieBlockedReasonUnknownError SetCookieBlockedReason = "UnknownError"
SetCookieBlockedReasonSecureOnly SetCookieBlockedReason = "SecureOnly"
SetCookieBlockedReasonSameSiteStrict SetCookieBlockedReason = "SameSiteStrict"
SetCookieBlockedReasonSameSiteLax SetCookieBlockedReason = "SameSiteLax"
SetCookieBlockedReasonSameSiteUnspecifiedTreatedAsLax SetCookieBlockedReason = "SameSiteUnspecifiedTreatedAsLax"
SetCookieBlockedReasonSameSiteNoneInsecure SetCookieBlockedReason = "SameSiteNoneInsecure"
SetCookieBlockedReasonUserPreferences SetCookieBlockedReason = "UserPreferences"
SetCookieBlockedReasonSyntaxError SetCookieBlockedReason = "SyntaxError"
SetCookieBlockedReasonSchemeNotSupported SetCookieBlockedReason = "SchemeNotSupported"
SetCookieBlockedReasonOverwriteSecure SetCookieBlockedReason = "OverwriteSecure"
SetCookieBlockedReasonInvalidDomain SetCookieBlockedReason = "InvalidDomain"
SetCookieBlockedReasonInvalidPrefix SetCookieBlockedReason = "InvalidPrefix"
SetCookieBlockedReasonUnknownError SetCookieBlockedReason = "UnknownError"
SetCookieBlockedReasonSchemefulSameSiteStrict SetCookieBlockedReason = "SchemefulSameSiteStrict"
SetCookieBlockedReasonSchemefulSameSiteLax SetCookieBlockedReason = "SchemefulSameSiteLax"
SetCookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax SetCookieBlockedReason = "SchemefulSameSiteUnspecifiedTreatedAsLax"
SetCookieBlockedReasonSamePartyFromCrossPartyContext SetCookieBlockedReason = "SamePartyFromCrossPartyContext"
SetCookieBlockedReasonSamePartyConflictsWithOtherAttributes SetCookieBlockedReason = "SamePartyConflictsWithOtherAttributes"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -827,6 +1079,16 @@ func (t *SetCookieBlockedReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = SetCookieBlockedReasonInvalidPrefix
case SetCookieBlockedReasonUnknownError:
*t = SetCookieBlockedReasonUnknownError
case SetCookieBlockedReasonSchemefulSameSiteStrict:
*t = SetCookieBlockedReasonSchemefulSameSiteStrict
case SetCookieBlockedReasonSchemefulSameSiteLax:
*t = SetCookieBlockedReasonSchemefulSameSiteLax
case SetCookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax:
*t = SetCookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax
case SetCookieBlockedReasonSamePartyFromCrossPartyContext:
*t = SetCookieBlockedReasonSamePartyFromCrossPartyContext
case SetCookieBlockedReasonSamePartyConflictsWithOtherAttributes:
*t = SetCookieBlockedReasonSamePartyConflictsWithOtherAttributes
default:
in.AddError(errors.New("unknown SetCookieBlockedReason value"))
@@ -851,15 +1113,19 @@ func (t CookieBlockedReason) String() string {
// CookieBlockedReason values.
const (
CookieBlockedReasonSecureOnly CookieBlockedReason = "SecureOnly"
CookieBlockedReasonNotOnPath CookieBlockedReason = "NotOnPath"
CookieBlockedReasonDomainMismatch CookieBlockedReason = "DomainMismatch"
CookieBlockedReasonSameSiteStrict CookieBlockedReason = "SameSiteStrict"
CookieBlockedReasonSameSiteLax CookieBlockedReason = "SameSiteLax"
CookieBlockedReasonSameSiteUnspecifiedTreatedAsLax CookieBlockedReason = "SameSiteUnspecifiedTreatedAsLax"
CookieBlockedReasonSameSiteNoneInsecure CookieBlockedReason = "SameSiteNoneInsecure"
CookieBlockedReasonUserPreferences CookieBlockedReason = "UserPreferences"
CookieBlockedReasonUnknownError CookieBlockedReason = "UnknownError"
CookieBlockedReasonSecureOnly CookieBlockedReason = "SecureOnly"
CookieBlockedReasonNotOnPath CookieBlockedReason = "NotOnPath"
CookieBlockedReasonDomainMismatch CookieBlockedReason = "DomainMismatch"
CookieBlockedReasonSameSiteStrict CookieBlockedReason = "SameSiteStrict"
CookieBlockedReasonSameSiteLax CookieBlockedReason = "SameSiteLax"
CookieBlockedReasonSameSiteUnspecifiedTreatedAsLax CookieBlockedReason = "SameSiteUnspecifiedTreatedAsLax"
CookieBlockedReasonSameSiteNoneInsecure CookieBlockedReason = "SameSiteNoneInsecure"
CookieBlockedReasonUserPreferences CookieBlockedReason = "UserPreferences"
CookieBlockedReasonUnknownError CookieBlockedReason = "UnknownError"
CookieBlockedReasonSchemefulSameSiteStrict CookieBlockedReason = "SchemefulSameSiteStrict"
CookieBlockedReasonSchemefulSameSiteLax CookieBlockedReason = "SchemefulSameSiteLax"
CookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax CookieBlockedReason = "SchemefulSameSiteUnspecifiedTreatedAsLax"
CookieBlockedReasonSamePartyFromCrossPartyContext CookieBlockedReason = "SamePartyFromCrossPartyContext"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -893,6 +1159,14 @@ func (t *CookieBlockedReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CookieBlockedReasonUserPreferences
case CookieBlockedReasonUnknownError:
*t = CookieBlockedReasonUnknownError
case CookieBlockedReasonSchemefulSameSiteStrict:
*t = CookieBlockedReasonSchemefulSameSiteStrict
case CookieBlockedReasonSchemefulSameSiteLax:
*t = CookieBlockedReasonSchemefulSameSiteLax
case CookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax:
*t = CookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax
case CookieBlockedReasonSamePartyFromCrossPartyContext:
*t = CookieBlockedReasonSamePartyFromCrossPartyContext
default:
in.AddError(errors.New("unknown CookieBlockedReason value"))
@@ -927,16 +1201,19 @@ type BlockedCookieWithReason struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CookieParam
type CookieParam struct {
Name string `json:"name"` // Cookie name.
Value string `json:"value"` // Cookie value.
URL string `json:"url,omitempty"` // The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie.
Domain string `json:"domain,omitempty"` // Cookie domain.
Path string `json:"path,omitempty"` // Cookie path.
Secure bool `json:"secure,omitempty"` // True if cookie is secure.
HTTPOnly bool `json:"httpOnly,omitempty"` // True if cookie is http-only.
SameSite CookieSameSite `json:"sameSite,omitempty"` // Cookie SameSite type.
Expires *cdp.TimeSinceEpoch `json:"expires,omitempty"` // Cookie expiration date, session cookie if not set
Priority CookiePriority `json:"priority,omitempty"` // Cookie Priority.
Name string `json:"name"` // Cookie name.
Value string `json:"value"` // Cookie value.
URL string `json:"url,omitempty"` // The request-URI to associate with the setting of the cookie. This value can affect the default domain, path, source port, and source scheme values of the created cookie.
Domain string `json:"domain,omitempty"` // Cookie domain.
Path string `json:"path,omitempty"` // Cookie path.
Secure bool `json:"secure,omitempty"` // True if cookie is secure.
HTTPOnly bool `json:"httpOnly,omitempty"` // True if cookie is http-only.
SameSite CookieSameSite `json:"sameSite,omitempty"` // Cookie SameSite type.
Expires *cdp.TimeSinceEpoch `json:"expires,omitempty"` // Cookie expiration date, session cookie if not set
Priority CookiePriority `json:"priority,omitempty"` // Cookie Priority.
SameParty bool `json:"sameParty,omitempty"` // True if cookie is SameParty.
SourceScheme CookieSourceScheme `json:"sourceScheme,omitempty"` // Cookie source scheme type.
SourcePort int64 `json:"sourcePort,omitempty"` // Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.
}
// AuthChallenge authorization challenge for HTTP status code 401 or 407.
@@ -1116,6 +1393,306 @@ type SignedExchangeInfo struct {
Errors []*SignedExchangeError `json:"errors,omitempty"` // Errors occurred while handling the signed exchagne.
}
// ContentEncoding list of content encodings supported by the backend.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-ContentEncoding
type ContentEncoding string
// String returns the ContentEncoding as string value.
func (t ContentEncoding) String() string {
return string(t)
}
// ContentEncoding values.
const (
ContentEncodingDeflate ContentEncoding = "deflate"
ContentEncodingGzip ContentEncoding = "gzip"
ContentEncodingBr ContentEncoding = "br"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t ContentEncoding) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t ContentEncoding) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *ContentEncoding) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch ContentEncoding(in.String()) {
case ContentEncodingDeflate:
*t = ContentEncodingDeflate
case ContentEncodingGzip:
*t = ContentEncodingGzip
case ContentEncodingBr:
*t = ContentEncodingBr
default:
in.AddError(errors.New("unknown ContentEncoding value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *ContentEncoding) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// PrivateNetworkRequestPolicy [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-PrivateNetworkRequestPolicy
type PrivateNetworkRequestPolicy string
// String returns the PrivateNetworkRequestPolicy as string value.
func (t PrivateNetworkRequestPolicy) String() string {
return string(t)
}
// PrivateNetworkRequestPolicy values.
const (
PrivateNetworkRequestPolicyAllow PrivateNetworkRequestPolicy = "Allow"
PrivateNetworkRequestPolicyBlockFromInsecureToMorePrivate PrivateNetworkRequestPolicy = "BlockFromInsecureToMorePrivate"
PrivateNetworkRequestPolicyWarnFromInsecureToMorePrivate PrivateNetworkRequestPolicy = "WarnFromInsecureToMorePrivate"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t PrivateNetworkRequestPolicy) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t PrivateNetworkRequestPolicy) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *PrivateNetworkRequestPolicy) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch PrivateNetworkRequestPolicy(in.String()) {
case PrivateNetworkRequestPolicyAllow:
*t = PrivateNetworkRequestPolicyAllow
case PrivateNetworkRequestPolicyBlockFromInsecureToMorePrivate:
*t = PrivateNetworkRequestPolicyBlockFromInsecureToMorePrivate
case PrivateNetworkRequestPolicyWarnFromInsecureToMorePrivate:
*t = PrivateNetworkRequestPolicyWarnFromInsecureToMorePrivate
default:
in.AddError(errors.New("unknown PrivateNetworkRequestPolicy value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *PrivateNetworkRequestPolicy) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// IPAddressSpace [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-IPAddressSpace
type IPAddressSpace string
// String returns the IPAddressSpace as string value.
func (t IPAddressSpace) String() string {
return string(t)
}
// IPAddressSpace values.
const (
IPAddressSpaceLocal IPAddressSpace = "Local"
IPAddressSpacePrivate IPAddressSpace = "Private"
IPAddressSpacePublic IPAddressSpace = "Public"
IPAddressSpaceUnknown IPAddressSpace = "Unknown"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t IPAddressSpace) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t IPAddressSpace) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *IPAddressSpace) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch IPAddressSpace(in.String()) {
case IPAddressSpaceLocal:
*t = IPAddressSpaceLocal
case IPAddressSpacePrivate:
*t = IPAddressSpacePrivate
case IPAddressSpacePublic:
*t = IPAddressSpacePublic
case IPAddressSpaceUnknown:
*t = IPAddressSpaceUnknown
default:
in.AddError(errors.New("unknown IPAddressSpace value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *IPAddressSpace) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// ClientSecurityState [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-ClientSecurityState
type ClientSecurityState struct {
InitiatorIsSecureContext bool `json:"initiatorIsSecureContext"`
InitiatorIPAddressSpace IPAddressSpace `json:"initiatorIPAddressSpace"`
PrivateNetworkRequestPolicy PrivateNetworkRequestPolicy `json:"privateNetworkRequestPolicy"`
}
// CrossOriginOpenerPolicyValue [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CrossOriginOpenerPolicyValue
type CrossOriginOpenerPolicyValue string
// String returns the CrossOriginOpenerPolicyValue as string value.
func (t CrossOriginOpenerPolicyValue) String() string {
return string(t)
}
// CrossOriginOpenerPolicyValue values.
const (
CrossOriginOpenerPolicyValueSameOrigin CrossOriginOpenerPolicyValue = "SameOrigin"
CrossOriginOpenerPolicyValueSameOriginAllowPopups CrossOriginOpenerPolicyValue = "SameOriginAllowPopups"
CrossOriginOpenerPolicyValueUnsafeNone CrossOriginOpenerPolicyValue = "UnsafeNone"
CrossOriginOpenerPolicyValueSameOriginPlusCoep CrossOriginOpenerPolicyValue = "SameOriginPlusCoep"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CrossOriginOpenerPolicyValue) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t CrossOriginOpenerPolicyValue) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CrossOriginOpenerPolicyValue) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch CrossOriginOpenerPolicyValue(in.String()) {
case CrossOriginOpenerPolicyValueSameOrigin:
*t = CrossOriginOpenerPolicyValueSameOrigin
case CrossOriginOpenerPolicyValueSameOriginAllowPopups:
*t = CrossOriginOpenerPolicyValueSameOriginAllowPopups
case CrossOriginOpenerPolicyValueUnsafeNone:
*t = CrossOriginOpenerPolicyValueUnsafeNone
case CrossOriginOpenerPolicyValueSameOriginPlusCoep:
*t = CrossOriginOpenerPolicyValueSameOriginPlusCoep
default:
in.AddError(errors.New("unknown CrossOriginOpenerPolicyValue value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *CrossOriginOpenerPolicyValue) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CrossOriginOpenerPolicyStatus [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CrossOriginOpenerPolicyStatus
type CrossOriginOpenerPolicyStatus struct {
Value CrossOriginOpenerPolicyValue `json:"value"`
ReportOnlyValue CrossOriginOpenerPolicyValue `json:"reportOnlyValue"`
ReportingEndpoint string `json:"reportingEndpoint,omitempty"`
ReportOnlyReportingEndpoint string `json:"reportOnlyReportingEndpoint,omitempty"`
}
// CrossOriginEmbedderPolicyValue [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CrossOriginEmbedderPolicyValue
type CrossOriginEmbedderPolicyValue string
// String returns the CrossOriginEmbedderPolicyValue as string value.
func (t CrossOriginEmbedderPolicyValue) String() string {
return string(t)
}
// CrossOriginEmbedderPolicyValue values.
const (
CrossOriginEmbedderPolicyValueNone CrossOriginEmbedderPolicyValue = "None"
CrossOriginEmbedderPolicyValueCredentialless CrossOriginEmbedderPolicyValue = "Credentialless"
CrossOriginEmbedderPolicyValueRequireCorp CrossOriginEmbedderPolicyValue = "RequireCorp"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CrossOriginEmbedderPolicyValue) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t CrossOriginEmbedderPolicyValue) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CrossOriginEmbedderPolicyValue) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch CrossOriginEmbedderPolicyValue(in.String()) {
case CrossOriginEmbedderPolicyValueNone:
*t = CrossOriginEmbedderPolicyValueNone
case CrossOriginEmbedderPolicyValueCredentialless:
*t = CrossOriginEmbedderPolicyValueCredentialless
case CrossOriginEmbedderPolicyValueRequireCorp:
*t = CrossOriginEmbedderPolicyValueRequireCorp
default:
in.AddError(errors.New("unknown CrossOriginEmbedderPolicyValue value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *CrossOriginEmbedderPolicyValue) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CrossOriginEmbedderPolicyStatus [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CrossOriginEmbedderPolicyStatus
type CrossOriginEmbedderPolicyStatus struct {
Value CrossOriginEmbedderPolicyValue `json:"value"`
ReportOnlyValue CrossOriginEmbedderPolicyValue `json:"reportOnlyValue"`
ReportingEndpoint string `json:"reportingEndpoint,omitempty"`
ReportOnlyReportingEndpoint string `json:"reportOnlyReportingEndpoint,omitempty"`
}
// SecurityIsolationStatus [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-SecurityIsolationStatus
type SecurityIsolationStatus struct {
Coop *CrossOriginOpenerPolicyStatus `json:"coop,omitempty"`
Coep *CrossOriginEmbedderPolicyStatus `json:"coep,omitempty"`
}
// LoadNetworkResourcePageResult an object providing the result of a network
// resource load.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-LoadNetworkResourcePageResult
type LoadNetworkResourcePageResult struct {
Success bool `json:"success"`
NetError float64 `json:"netError,omitempty"` // Optional values used for error reporting.
NetErrorName string `json:"netErrorName,omitempty"`
HTTPStatusCode float64 `json:"httpStatusCode,omitempty"`
Stream io.StreamHandle `json:"stream,omitempty"` // If successful, one of the following two fields holds the result.
Headers Headers `json:"headers,omitempty"` // Response headers.
}
// LoadNetworkResourceOptions an options object that may be extended later to
// better support CORS, CORB and streaming.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-LoadNetworkResourceOptions
type LoadNetworkResourceOptions struct {
DisableCache bool `json:"disableCache"`
IncludeCredentials bool `json:"includeCredentials"`
}
// ReferrerPolicy the referrer policy of the request, as defined in
// https://www.w3.org/TR/referrer-policy/.
//
@@ -1179,6 +1756,51 @@ func (t *ReferrerPolicy) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// TrustTokenParamsRefreshPolicy only set for "token-redemption" type and
// determine whether to request a fresh SRR or use a still valid cached SRR.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-TrustTokenParams
type TrustTokenParamsRefreshPolicy string
// String returns the TrustTokenParamsRefreshPolicy as string value.
func (t TrustTokenParamsRefreshPolicy) String() string {
return string(t)
}
// TrustTokenParamsRefreshPolicy values.
const (
TrustTokenParamsRefreshPolicyUseCached TrustTokenParamsRefreshPolicy = "UseCached"
TrustTokenParamsRefreshPolicyRefresh TrustTokenParamsRefreshPolicy = "Refresh"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t TrustTokenParamsRefreshPolicy) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t TrustTokenParamsRefreshPolicy) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *TrustTokenParamsRefreshPolicy) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch TrustTokenParamsRefreshPolicy(in.String()) {
case TrustTokenParamsRefreshPolicyUseCached:
*t = TrustTokenParamsRefreshPolicyUseCached
case TrustTokenParamsRefreshPolicyRefresh:
*t = TrustTokenParamsRefreshPolicyRefresh
default:
in.AddError(errors.New("unknown TrustTokenParamsRefreshPolicy value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *TrustTokenParamsRefreshPolicy) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// InitiatorType type of this initiator.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-Initiator
@@ -1195,6 +1817,7 @@ const (
InitiatorTypeScript InitiatorType = "script"
InitiatorTypePreload InitiatorType = "preload"
InitiatorTypeSignedExchange InitiatorType = "SignedExchange"
InitiatorTypePreflight InitiatorType = "preflight"
InitiatorTypeOther InitiatorType = "other"
)
@@ -1219,6 +1842,8 @@ func (t *InitiatorType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = InitiatorTypePreload
case InitiatorTypeSignedExchange:
*t = InitiatorTypeSignedExchange
case InitiatorTypePreflight:
*t = InitiatorTypePreflight
case InitiatorTypeOther:
*t = InitiatorTypeOther
@@ -1325,3 +1950,74 @@ func (t *AuthChallengeResponseResponse) UnmarshalEasyJSON(in *jlexer.Lexer) {
func (t *AuthChallengeResponseResponse) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// TrustTokenOperationDoneStatus detailed success or error status of the
// operation. 'AlreadyExists' also signifies a successful operation, as the
// result of the operation already exists und thus, the operation was abort
// preemptively (e.g. a cache hit).
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-trustTokenOperationDone
type TrustTokenOperationDoneStatus string
// String returns the TrustTokenOperationDoneStatus as string value.
func (t TrustTokenOperationDoneStatus) String() string {
return string(t)
}
// TrustTokenOperationDoneStatus values.
const (
TrustTokenOperationDoneStatusOk TrustTokenOperationDoneStatus = "Ok"
TrustTokenOperationDoneStatusInvalidArgument TrustTokenOperationDoneStatus = "InvalidArgument"
TrustTokenOperationDoneStatusFailedPrecondition TrustTokenOperationDoneStatus = "FailedPrecondition"
TrustTokenOperationDoneStatusResourceExhausted TrustTokenOperationDoneStatus = "ResourceExhausted"
TrustTokenOperationDoneStatusAlreadyExists TrustTokenOperationDoneStatus = "AlreadyExists"
TrustTokenOperationDoneStatusUnavailable TrustTokenOperationDoneStatus = "Unavailable"
TrustTokenOperationDoneStatusBadResponse TrustTokenOperationDoneStatus = "BadResponse"
TrustTokenOperationDoneStatusInternalError TrustTokenOperationDoneStatus = "InternalError"
TrustTokenOperationDoneStatusUnknownError TrustTokenOperationDoneStatus = "UnknownError"
TrustTokenOperationDoneStatusFulfilledLocally TrustTokenOperationDoneStatus = "FulfilledLocally"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t TrustTokenOperationDoneStatus) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t TrustTokenOperationDoneStatus) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *TrustTokenOperationDoneStatus) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch TrustTokenOperationDoneStatus(in.String()) {
case TrustTokenOperationDoneStatusOk:
*t = TrustTokenOperationDoneStatusOk
case TrustTokenOperationDoneStatusInvalidArgument:
*t = TrustTokenOperationDoneStatusInvalidArgument
case TrustTokenOperationDoneStatusFailedPrecondition:
*t = TrustTokenOperationDoneStatusFailedPrecondition
case TrustTokenOperationDoneStatusResourceExhausted:
*t = TrustTokenOperationDoneStatusResourceExhausted
case TrustTokenOperationDoneStatusAlreadyExists:
*t = TrustTokenOperationDoneStatusAlreadyExists
case TrustTokenOperationDoneStatusUnavailable:
*t = TrustTokenOperationDoneStatusUnavailable
case TrustTokenOperationDoneStatusBadResponse:
*t = TrustTokenOperationDoneStatusBadResponse
case TrustTokenOperationDoneStatusInternalError:
*t = TrustTokenOperationDoneStatusInternalError
case TrustTokenOperationDoneStatusUnknownError:
*t = TrustTokenOperationDoneStatusUnknownError
case TrustTokenOperationDoneStatusFulfilledLocally:
*t = TrustTokenOperationDoneStatusFulfilledLocally
default:
in.AddError(errors.New("unknown TrustTokenOperationDoneStatus value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *TrustTokenOperationDoneStatus) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}