// Package network provides the Chrome DevTools Protocol// commands, types, and events for the Network domain.//// Network domain allows tracking network activities of the page. It exposes// information about http, file, data and other requests and responses, their// headers, bodies, timing, etc.//// Generated by the cdproto-gen command.
package network// Code generated by cdproto-gen. DO NOT EDIT.import ()// SetAcceptedEncodingsParams sets a list of content encodings that will be// accepted. Empty list means no encoding is accepted.typeSetAcceptedEncodingsParamsstruct { 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 ( []ContentEncoding) *SetAcceptedEncodingsParams {return &SetAcceptedEncodingsParams{Encodings: , }}// Do executes Network.setAcceptedEncodings against the provided context.func ( *SetAcceptedEncodingsParams) ( context.Context) ( error) {returncdp.Execute(, CommandSetAcceptedEncodings, , nil)}// ClearAcceptedEncodingsOverrideParams clears accepted encodings set by// setAcceptedEncodings.typeClearAcceptedEncodingsOverrideParamsstruct{}// ClearAcceptedEncodingsOverride clears accepted encodings set by// setAcceptedEncodings.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-clearAcceptedEncodingsOverridefunc () *ClearAcceptedEncodingsOverrideParams {return &ClearAcceptedEncodingsOverrideParams{}}// Do executes Network.clearAcceptedEncodingsOverride against the provided context.func ( *ClearAcceptedEncodingsOverrideParams) ( context.Context) ( error) {returncdp.Execute(, CommandClearAcceptedEncodingsOverride, nil, nil)}// ClearBrowserCacheParams clears browser cache.typeClearBrowserCacheParamsstruct{}// ClearBrowserCache clears browser cache.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-clearBrowserCachefunc () *ClearBrowserCacheParams {return &ClearBrowserCacheParams{}}// Do executes Network.clearBrowserCache against the provided context.func ( *ClearBrowserCacheParams) ( context.Context) ( error) {returncdp.Execute(, CommandClearBrowserCache, nil, nil)}// ClearBrowserCookiesParams clears browser cookies.typeClearBrowserCookiesParamsstruct{}// ClearBrowserCookies clears browser cookies.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-clearBrowserCookiesfunc () *ClearBrowserCookiesParams {return &ClearBrowserCookiesParams{}}// Do executes Network.clearBrowserCookies against the provided context.func ( *ClearBrowserCookiesParams) ( context.Context) ( error) {returncdp.Execute(, CommandClearBrowserCookies, nil, nil)}// DeleteCookiesParams deletes browser cookies with matching name and url or// domain/path pair.typeDeleteCookiesParamsstruct { Name string`json:"name"`// Name of the cookies to remove. URL string`json:"url,omitempty"`// If specified, deletes all the cookies with the given name where domain and path match provided URL. Domain string`json:"domain,omitempty"`// If specified, deletes only cookies with the exact domain. Path string`json:"path,omitempty"`// If specified, deletes only cookies with the exact path.}// DeleteCookies deletes browser cookies with matching name and url or// domain/path pair.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-deleteCookies//// parameters://// name - Name of the cookies to remove.func ( string) *DeleteCookiesParams {return &DeleteCookiesParams{Name: , }}// WithURL if specified, deletes all the cookies with the given name where// domain and path match provided URL.func ( DeleteCookiesParams) ( string) *DeleteCookiesParams { .URL = return &}// WithDomain if specified, deletes only cookies with the exact domain.func ( DeleteCookiesParams) ( string) *DeleteCookiesParams { .Domain = return &}// WithPath if specified, deletes only cookies with the exact path.func ( DeleteCookiesParams) ( string) *DeleteCookiesParams { .Path = return &}// Do executes Network.deleteCookies against the provided context.func ( *DeleteCookiesParams) ( context.Context) ( error) {returncdp.Execute(, CommandDeleteCookies, , nil)}// DisableParams disables network tracking, prevents network events from// being sent to the client.typeDisableParamsstruct{}// Disable disables network tracking, prevents network events from being sent// to the client.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-disablefunc () *DisableParams {return &DisableParams{}}// Do executes Network.disable against the provided context.func ( *DisableParams) ( context.Context) ( error) {returncdp.Execute(, CommandDisable, nil, nil)}// EmulateNetworkConditionsParams activates emulation of network conditions.typeEmulateNetworkConditionsParamsstruct { Offline bool`json:"offline"`// True to emulate internet disconnection. Latency float64`json:"latency"`// Minimum latency from request sent to response headers received (ms). DownloadThroughput float64`json:"downloadThroughput"`// Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. UploadThroughput float64`json:"uploadThroughput"`// Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. ConnectionType ConnectionType`json:"connectionType,omitempty"`// Connection type if known.}// EmulateNetworkConditions activates emulation of network conditions.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-emulateNetworkConditions//// parameters://// offline - True to emulate internet disconnection.// latency - Minimum latency from request sent to response headers received (ms).// downloadThroughput - Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.// uploadThroughput - Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.func ( bool, float64, float64, float64) *EmulateNetworkConditionsParams {return &EmulateNetworkConditionsParams{Offline: ,Latency: ,DownloadThroughput: ,UploadThroughput: , }}// WithConnectionType connection type if known.func ( EmulateNetworkConditionsParams) ( ConnectionType) *EmulateNetworkConditionsParams { .ConnectionType = return &}// Do executes Network.emulateNetworkConditions against the provided context.func ( *EmulateNetworkConditionsParams) ( context.Context) ( error) {returncdp.Execute(, CommandEmulateNetworkConditions, , nil)}// EnableParams enables network tracking, network events will now be// delivered to the client.typeEnableParamsstruct { MaxTotalBufferSize int64`json:"maxTotalBufferSize,omitempty"`// Buffer size in bytes to use when preserving network payloads (XHRs, etc). MaxResourceBufferSize int64`json:"maxResourceBufferSize,omitempty"`// Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc). MaxPostDataSize int64`json:"maxPostDataSize,omitempty"`// Longest post body size (in bytes) that would be included in requestWillBeSent notification}// Enable enables network tracking, network events will now be delivered to// the client.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-enable//// parameters:func () *EnableParams {return &EnableParams{}}// WithMaxTotalBufferSize buffer size in bytes to use when preserving network// payloads (XHRs, etc).func ( EnableParams) ( int64) *EnableParams { .MaxTotalBufferSize = return &}// WithMaxResourceBufferSize per-resource buffer size in bytes to use when// preserving network payloads (XHRs, etc).func ( EnableParams) ( int64) *EnableParams { .MaxResourceBufferSize = return &}// WithMaxPostDataSize longest post body size (in bytes) that would be// included in requestWillBeSent notification.func ( EnableParams) ( int64) *EnableParams { .MaxPostDataSize = return &}// Do executes Network.enable against the provided context.func ( *EnableParams) ( context.Context) ( error) {returncdp.Execute(, CommandEnable, , nil)}// GetCertificateParams returns the DER-encoded certificate.typeGetCertificateParamsstruct { Origin string`json:"origin"`// Origin to get certificate for.}// GetCertificate returns the DER-encoded certificate.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getCertificate//// parameters://// origin - Origin to get certificate for.func ( string) *GetCertificateParams {return &GetCertificateParams{Origin: , }}// GetCertificateReturns return values.typeGetCertificateReturnsstruct { TableNames []string`json:"tableNames,omitempty"`}// Do executes Network.getCertificate against the provided context.//// returns://// tableNamesfunc ( *GetCertificateParams) ( context.Context) ( []string, error) {// executevarGetCertificateReturns = cdp.Execute(, CommandGetCertificate, , &)if != nil {returnnil, }return .TableNames, nil}// GetCookiesParams returns all browser cookies for the current URL.// Depending on the backend support, will return detailed cookie information in// the cookies field.typeGetCookiesParamsstruct { 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// the backend support, will return detailed cookie information in the cookies// field.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getCookies//// parameters:func () *GetCookiesParams {return &GetCookiesParams{}}// 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 ( GetCookiesParams) ( []string) *GetCookiesParams { .Urls = return &}// GetCookiesReturns return values.typeGetCookiesReturnsstruct { Cookies []*Cookie`json:"cookies,omitempty"`// Array of cookie objects.}// Do executes Network.getCookies against the provided context.//// returns://// cookies - Array of cookie objects.func ( *GetCookiesParams) ( context.Context) ( []*Cookie, error) {// executevarGetCookiesReturns = cdp.Execute(, CommandGetCookies, , &)if != nil {returnnil, }return .Cookies, nil}// GetResponseBodyParams returns content served for the given request.typeGetResponseBodyParamsstruct { RequestID RequestID`json:"requestId"`// Identifier of the network request to get content for.}// GetResponseBody returns content served for the given request.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getResponseBody//// parameters://// requestID - Identifier of the network request to get content for.func ( RequestID) *GetResponseBodyParams {return &GetResponseBodyParams{RequestID: , }}// GetResponseBodyReturns return values.typeGetResponseBodyReturnsstruct { Body string`json:"body,omitempty"`// Response body. Base64encoded bool`json:"base64Encoded,omitempty"`// True, if content was sent as base64.}// Do executes Network.getResponseBody against the provided context.//// returns://// body - Response body.func ( *GetResponseBodyParams) ( context.Context) ( []byte, error) {// executevarGetResponseBodyReturns = cdp.Execute(, CommandGetResponseBody, , &)if != nil {returnnil, }// decodevar []byteif .Base64encoded { , = base64.StdEncoding.DecodeString(.Body)if != nil {returnnil, } } else { = []byte(.Body) }return , nil}// GetRequestPostDataParams returns post data sent with the request. Returns// an error when no data was sent with the request.typeGetRequestPostDataParamsstruct { RequestID RequestID`json:"requestId"`// Identifier of the network request to get content for.}// GetRequestPostData returns post data sent with the request. Returns an// error when no data was sent with the request.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getRequestPostData//// parameters://// requestID - Identifier of the network request to get content for.func ( RequestID) *GetRequestPostDataParams {return &GetRequestPostDataParams{RequestID: , }}// GetRequestPostDataReturns return values.typeGetRequestPostDataReturnsstruct { PostData string`json:"postData,omitempty"`// Request body string, omitting files from multipart requests}// Do executes Network.getRequestPostData against the provided context.//// returns://// postData - Request body string, omitting files from multipart requestsfunc ( *GetRequestPostDataParams) ( context.Context) ( string, error) {// executevarGetRequestPostDataReturns = cdp.Execute(, CommandGetRequestPostData, , &)if != nil {return"", }return .PostData, nil}// GetResponseBodyForInterceptionParams returns content served for the given// currently intercepted request.typeGetResponseBodyForInterceptionParamsstruct { InterceptionID InterceptionID`json:"interceptionId"`// Identifier for the intercepted request to get body for.}// GetResponseBodyForInterception returns content served for the given// currently intercepted request.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getResponseBodyForInterception//// parameters://// interceptionID - Identifier for the intercepted request to get body for.func ( InterceptionID) *GetResponseBodyForInterceptionParams {return &GetResponseBodyForInterceptionParams{InterceptionID: , }}// GetResponseBodyForInterceptionReturns return values.typeGetResponseBodyForInterceptionReturnsstruct { Body string`json:"body,omitempty"`// Response body. Base64encoded bool`json:"base64Encoded,omitempty"`// True, if content was sent as base64.}// Do executes Network.getResponseBodyForInterception against the provided context.//// returns://// body - Response body.func ( *GetResponseBodyForInterceptionParams) ( context.Context) ( []byte, error) {// executevarGetResponseBodyForInterceptionReturns = cdp.Execute(, CommandGetResponseBodyForInterception, , &)if != nil {returnnil, }// decodevar []byteif .Base64encoded { , = base64.StdEncoding.DecodeString(.Body)if != nil {returnnil, } } else { = []byte(.Body) }return , nil}// TakeResponseBodyForInterceptionAsStreamParams returns a handle to the// stream representing the response body. Note that after this command, the// intercepted request can't be continued as is -- you either need to cancel it// or to provide the response body. The stream only supports sequential read,// IO.read will fail if the position is specified.typeTakeResponseBodyForInterceptionAsStreamParamsstruct { InterceptionID InterceptionID`json:"interceptionId"`}// TakeResponseBodyForInterceptionAsStream returns a handle to the stream// representing the response body. Note that after this command, the intercepted// request can't be continued as is -- you either need to cancel it or to// provide the response body. The stream only supports sequential read, IO.read// will fail if the position is specified.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-takeResponseBodyForInterceptionAsStream//// parameters://// interceptionIDfunc ( InterceptionID) *TakeResponseBodyForInterceptionAsStreamParams {return &TakeResponseBodyForInterceptionAsStreamParams{InterceptionID: , }}// TakeResponseBodyForInterceptionAsStreamReturns return values.typeTakeResponseBodyForInterceptionAsStreamReturnsstruct { Stream io.StreamHandle`json:"stream,omitempty"`}// Do executes Network.takeResponseBodyForInterceptionAsStream against the provided context.//// returns://// streamfunc ( *TakeResponseBodyForInterceptionAsStreamParams) ( context.Context) ( io.StreamHandle, error) {// executevarTakeResponseBodyForInterceptionAsStreamReturns = cdp.Execute(, CommandTakeResponseBodyForInterceptionAsStream, , &)if != nil {return"", }return .Stream, nil}// ReplayXHRParams this method sends a new XMLHttpRequest which is identical// to the original one. The following parameters should be identical: method,// url, async, request body, extra headers, withCredentials attribute, user,// password.typeReplayXHRParamsstruct { RequestID RequestID`json:"requestId"`// Identifier of XHR to replay.}// ReplayXHR this method sends a new XMLHttpRequest which is identical to the// original one. The following parameters should be identical: method, url,// async, request body, extra headers, withCredentials attribute, user,// password.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-replayXHR//// parameters://// requestID - Identifier of XHR to replay.func ( RequestID) *ReplayXHRParams {return &ReplayXHRParams{RequestID: , }}// Do executes Network.replayXHR against the provided context.func ( *ReplayXHRParams) ( context.Context) ( error) {returncdp.Execute(, CommandReplayXHR, , nil)}// SearchInResponseBodyParams searches for given string in response content.typeSearchInResponseBodyParamsstruct { RequestID RequestID`json:"requestId"`// Identifier of the network response to search. Query string`json:"query"`// String to search for. CaseSensitive bool`json:"caseSensitive,omitempty"`// If true, search is case sensitive. IsRegex bool`json:"isRegex,omitempty"`// If true, treats string parameter as regex.}// SearchInResponseBody searches for given string in response content.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-searchInResponseBody//// parameters://// requestID - Identifier of the network response to search.// query - String to search for.func ( RequestID, string) *SearchInResponseBodyParams {return &SearchInResponseBodyParams{RequestID: ,Query: , }}// WithCaseSensitive if true, search is case sensitive.func ( SearchInResponseBodyParams) ( bool) *SearchInResponseBodyParams { .CaseSensitive = return &}// WithIsRegex if true, treats string parameter as regex.func ( SearchInResponseBodyParams) ( bool) *SearchInResponseBodyParams { .IsRegex = return &}// SearchInResponseBodyReturns return values.typeSearchInResponseBodyReturnsstruct { Result []*debugger.SearchMatch`json:"result,omitempty"`// List of search matches.}// Do executes Network.searchInResponseBody against the provided context.//// returns://// result - List of search matches.func ( *SearchInResponseBodyParams) ( context.Context) ( []*debugger.SearchMatch, error) {// executevarSearchInResponseBodyReturns = cdp.Execute(, CommandSearchInResponseBody, , &)if != nil {returnnil, }return .Result, nil}// SetBlockedURLSParams blocks URLs from loading.typeSetBlockedURLSParamsstruct { Urls []string`json:"urls"`// URL patterns to block. Wildcards ('*') are allowed.}// SetBlockedURLS blocks URLs from loading.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setBlockedURLs//// parameters://// urls - URL patterns to block. Wildcards ('*') are allowed.func ( []string) *SetBlockedURLSParams {return &SetBlockedURLSParams{Urls: , }}// Do executes Network.setBlockedURLs against the provided context.func ( *SetBlockedURLSParams) ( context.Context) ( error) {returncdp.Execute(, CommandSetBlockedURLS, , nil)}// SetBypassServiceWorkerParams toggles ignoring of service worker for each// request.typeSetBypassServiceWorkerParamsstruct { Bypass bool`json:"bypass"`// Bypass service worker and load from network.}// SetBypassServiceWorker toggles ignoring of service worker for each// request.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setBypassServiceWorker//// parameters://// bypass - Bypass service worker and load from network.func ( bool) *SetBypassServiceWorkerParams {return &SetBypassServiceWorkerParams{Bypass: , }}// Do executes Network.setBypassServiceWorker against the provided context.func ( *SetBypassServiceWorkerParams) ( context.Context) ( error) {returncdp.Execute(, CommandSetBypassServiceWorker, , nil)}// SetCacheDisabledParams toggles ignoring cache for each request. If true,// cache will not be used.typeSetCacheDisabledParamsstruct { CacheDisabled bool`json:"cacheDisabled"`// Cache disabled state.}// SetCacheDisabled toggles ignoring cache for each request. If true, cache// will not be used.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setCacheDisabled//// parameters://// cacheDisabled - Cache disabled state.func ( bool) *SetCacheDisabledParams {return &SetCacheDisabledParams{CacheDisabled: , }}// Do executes Network.setCacheDisabled against the provided context.func ( *SetCacheDisabledParams) ( context.Context) ( error) {returncdp.Execute(, CommandSetCacheDisabled, , nil)}// SetCookieParams sets a cookie with the given cookie data; may overwrite// equivalent cookies if they exist.typeSetCookieParamsstruct { 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. PartitionKey string`json:"partitionKey,omitempty"`// Cookie partition key. The site of the top-level URL the browser was visiting at the start of the request to the endpoint that set the cookie. If not set, the cookie will be set as not partitioned.}// SetCookie sets a cookie with the given cookie data; may overwrite// equivalent cookies if they exist.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setCookie//// parameters://// name - Cookie name.// value - Cookie value.func ( string, string) *SetCookieParams {return &SetCookieParams{Name: ,Value: , }}// WithURL 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.func ( SetCookieParams) ( string) *SetCookieParams { .URL = return &}// WithDomain cookie domain.func ( SetCookieParams) ( string) *SetCookieParams { .Domain = return &}// WithPath cookie path.func ( SetCookieParams) ( string) *SetCookieParams { .Path = return &}// WithSecure true if cookie is secure.func ( SetCookieParams) ( bool) *SetCookieParams { .Secure = return &}// WithHTTPOnly true if cookie is http-only.func ( SetCookieParams) ( bool) *SetCookieParams { .HTTPOnly = return &}// WithSameSite cookie SameSite type.func ( SetCookieParams) ( CookieSameSite) *SetCookieParams { .SameSite = return &}// WithExpires cookie expiration date, session cookie if not set.func ( SetCookieParams) ( *cdp.TimeSinceEpoch) *SetCookieParams { .Expires = return &}// WithPriority cookie Priority type.func ( SetCookieParams) ( CookiePriority) *SetCookieParams { .Priority = return &}// WithSameParty true if cookie is SameParty.func ( SetCookieParams) ( bool) *SetCookieParams { .SameParty = return &}// WithSourceScheme cookie source scheme type.func ( SetCookieParams) ( CookieSourceScheme) *SetCookieParams { .SourceScheme = return &}// 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 ( SetCookieParams) ( int64) *SetCookieParams { .SourcePort = return &}// WithPartitionKey cookie partition key. The site of the top-level URL the// browser was visiting at the start of the request to the endpoint that set the// cookie. If not set, the cookie will be set as not partitioned.func ( SetCookieParams) ( string) *SetCookieParams { .PartitionKey = return &}// Do executes Network.setCookie against the provided context.func ( *SetCookieParams) ( context.Context) ( error) {returncdp.Execute(, CommandSetCookie, , nil)}// SetCookiesParams sets given cookies.typeSetCookiesParamsstruct { Cookies []*CookieParam`json:"cookies"`// Cookies to be set.}// SetCookies sets given cookies.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setCookies//// parameters://// cookies - Cookies to be set.func ( []*CookieParam) *SetCookiesParams {return &SetCookiesParams{Cookies: , }}// Do executes Network.setCookies against the provided context.func ( *SetCookiesParams) ( context.Context) ( error) {returncdp.Execute(, CommandSetCookies, , nil)}// SetExtraHTTPHeadersParams specifies whether to always send extra HTTP// headers with the requests from this page.typeSetExtraHTTPHeadersParamsstruct { Headers Headers`json:"headers"`// Map with extra HTTP headers.}// SetExtraHTTPHeaders specifies whether to always send extra HTTP headers// with the requests from this page.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setExtraHTTPHeaders//// parameters://// headers - Map with extra HTTP headers.func ( Headers) *SetExtraHTTPHeadersParams {return &SetExtraHTTPHeadersParams{Headers: , }}// Do executes Network.setExtraHTTPHeaders against the provided context.func ( *SetExtraHTTPHeadersParams) ( context.Context) ( error) {returncdp.Execute(, CommandSetExtraHTTPHeaders, , nil)}// SetAttachDebugStackParams specifies whether to attach a page script stack// id in requests.typeSetAttachDebugStackParamsstruct { 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 ( bool) *SetAttachDebugStackParams {return &SetAttachDebugStackParams{Enabled: , }}// Do executes Network.setAttachDebugStack against the provided context.func ( *SetAttachDebugStackParams) ( context.Context) ( error) {returncdp.Execute(, CommandSetAttachDebugStack, , nil)}// GetSecurityIsolationStatusParams returns information about the COEP/COOP// isolation status.typeGetSecurityIsolationStatusParamsstruct { 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 () *GetSecurityIsolationStatusParams {return &GetSecurityIsolationStatusParams{}}// WithFrameID if no frameId is provided, the status of the target is// provided.func ( GetSecurityIsolationStatusParams) ( cdp.FrameID) *GetSecurityIsolationStatusParams { .FrameID = return &}// GetSecurityIsolationStatusReturns return values.typeGetSecurityIsolationStatusReturnsstruct { Status *SecurityIsolationStatus`json:"status,omitempty"`}// Do executes Network.getSecurityIsolationStatus against the provided context.//// returns://// statusfunc ( *GetSecurityIsolationStatusParams) ( context.Context) ( *SecurityIsolationStatus, error) {// executevarGetSecurityIsolationStatusReturns = cdp.Execute(, CommandGetSecurityIsolationStatus, , &)if != nil {returnnil, }return .Status, nil}// EnableReportingAPIParams enables tracking for the Reporting API, events// generated by the Reporting API will now be delivered to the client. Enabling// triggers 'reportingApiReportAdded' for all existing reports.typeEnableReportingAPIParamsstruct { Enable bool`json:"enable"`// Whether to enable or disable events for the Reporting API}// EnableReportingAPI enables tracking for the Reporting API, events// generated by the Reporting API will now be delivered to the client. Enabling// triggers 'reportingApiReportAdded' for all existing reports.//// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-enableReportingApi//// parameters://// enable - Whether to enable or disable events for the Reporting APIfunc ( bool) *EnableReportingAPIParams {return &EnableReportingAPIParams{Enable: , }}// Do executes Network.enableReportingApi against the provided context.func ( *EnableReportingAPIParams) ( context.Context) ( error) {returncdp.Execute(, CommandEnableReportingAPI, , nil)}// LoadNetworkResourceParams fetches the resource and returns the content.typeLoadNetworkResourceParamsstruct { FrameID cdp.FrameID`json:"frameId,omitempty"`// Frame id to get the resource for. Mandatory for frame targets, and should be omitted for worker targets. 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://// url - URL of the resource to get content for.// options - Options for the request.func ( string, *LoadNetworkResourceOptions) *LoadNetworkResourceParams {return &LoadNetworkResourceParams{URL: ,Options: , }}// WithFrameID frame id to get the resource for. Mandatory for frame targets,// and should be omitted for worker targets.func ( LoadNetworkResourceParams) ( cdp.FrameID) *LoadNetworkResourceParams { .FrameID = return &}// LoadNetworkResourceReturns return values.typeLoadNetworkResourceReturnsstruct { Resource *LoadNetworkResourcePageResult`json:"resource,omitempty"`}// Do executes Network.loadNetworkResource against the provided context.//// returns://// resourcefunc ( *LoadNetworkResourceParams) ( context.Context) ( *LoadNetworkResourcePageResult, error) {// executevarLoadNetworkResourceReturns = cdp.Execute(, CommandLoadNetworkResource, , &)if != nil {returnnil, }return .Resource, nil}// Command names.const (CommandSetAcceptedEncodings = "Network.setAcceptedEncodings"CommandClearAcceptedEncodingsOverride = "Network.clearAcceptedEncodingsOverride"CommandClearBrowserCache = "Network.clearBrowserCache"CommandClearBrowserCookies = "Network.clearBrowserCookies"CommandDeleteCookies = "Network.deleteCookies"CommandDisable = "Network.disable"CommandEmulateNetworkConditions = "Network.emulateNetworkConditions"CommandEnable = "Network.enable"CommandGetCertificate = "Network.getCertificate"CommandGetCookies = "Network.getCookies"CommandGetResponseBody = "Network.getResponseBody"CommandGetRequestPostData = "Network.getRequestPostData"CommandGetResponseBodyForInterception = "Network.getResponseBodyForInterception"CommandTakeResponseBodyForInterceptionAsStream = "Network.takeResponseBodyForInterceptionAsStream"CommandReplayXHR = "Network.replayXHR"CommandSearchInResponseBody = "Network.searchInResponseBody"CommandSetBlockedURLS = "Network.setBlockedURLs"CommandSetBypassServiceWorker = "Network.setBypassServiceWorker"CommandSetCacheDisabled = "Network.setCacheDisabled"CommandSetCookie = "Network.setCookie"CommandSetCookies = "Network.setCookies"CommandSetExtraHTTPHeaders = "Network.setExtraHTTPHeaders"CommandSetAttachDebugStack = "Network.setAttachDebugStack"CommandGetSecurityIsolationStatus = "Network.getSecurityIsolationStatus"CommandEnableReportingAPI = "Network.enableReportingApi"CommandLoadNetworkResource = "Network.loadNetworkResource")
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.