Updating to latest protocol.json

This commit is contained in:
Kenneth Shaw 2017-08-03 12:37:27 +07:00
parent 10a6f7bd20
commit e5bd576a97
13 changed files with 432 additions and 712 deletions

View File

@ -265,6 +265,7 @@ func (t AXGlobalStates) String() string {
// AXGlobalStates values. // AXGlobalStates values.
const ( const (
AXGlobalStatesBusy AXGlobalStates = "busy"
AXGlobalStatesDisabled AXGlobalStates = "disabled" AXGlobalStatesDisabled AXGlobalStates = "disabled"
AXGlobalStatesHidden AXGlobalStates = "hidden" AXGlobalStatesHidden AXGlobalStates = "hidden"
AXGlobalStatesHiddenRoot AXGlobalStates = "hiddenRoot" AXGlobalStatesHiddenRoot AXGlobalStates = "hiddenRoot"
@ -286,6 +287,8 @@ func (t AXGlobalStates) MarshalJSON() ([]byte, error) {
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. // UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *AXGlobalStates) UnmarshalEasyJSON(in *jlexer.Lexer) { func (t *AXGlobalStates) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch AXGlobalStates(in.String()) { switch AXGlobalStates(in.String()) {
case AXGlobalStatesBusy:
*t = AXGlobalStatesBusy
case AXGlobalStatesDisabled: case AXGlobalStatesDisabled:
*t = AXGlobalStatesDisabled *t = AXGlobalStatesDisabled
case AXGlobalStatesHidden: case AXGlobalStatesHidden:
@ -322,7 +325,6 @@ const (
AXLiveRegionAttributesLive AXLiveRegionAttributes = "live" AXLiveRegionAttributesLive AXLiveRegionAttributes = "live"
AXLiveRegionAttributesAtomic AXLiveRegionAttributes = "atomic" AXLiveRegionAttributesAtomic AXLiveRegionAttributes = "atomic"
AXLiveRegionAttributesRelevant AXLiveRegionAttributes = "relevant" AXLiveRegionAttributesRelevant AXLiveRegionAttributes = "relevant"
AXLiveRegionAttributesBusy AXLiveRegionAttributes = "busy"
AXLiveRegionAttributesRoot AXLiveRegionAttributes = "root" AXLiveRegionAttributesRoot AXLiveRegionAttributes = "root"
) )
@ -345,8 +347,6 @@ func (t *AXLiveRegionAttributes) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = AXLiveRegionAttributesAtomic *t = AXLiveRegionAttributesAtomic
case AXLiveRegionAttributesRelevant: case AXLiveRegionAttributesRelevant:
*t = AXLiveRegionAttributesRelevant *t = AXLiveRegionAttributesRelevant
case AXLiveRegionAttributesBusy:
*t = AXLiveRegionAttributesBusy
case AXLiveRegionAttributesRoot: case AXLiveRegionAttributesRoot:
*t = AXLiveRegionAttributesRoot *t = AXLiveRegionAttributesRoot

View File

@ -72,7 +72,6 @@ const (
EventPageScreencastVisibilityChanged MethodType = "Page.screencastVisibilityChanged" EventPageScreencastVisibilityChanged MethodType = "Page.screencastVisibilityChanged"
EventPageInterstitialShown MethodType = "Page.interstitialShown" EventPageInterstitialShown MethodType = "Page.interstitialShown"
EventPageInterstitialHidden MethodType = "Page.interstitialHidden" EventPageInterstitialHidden MethodType = "Page.interstitialHidden"
EventPageNavigationRequested MethodType = "Page.navigationRequested"
CommandPageEnable MethodType = "Page.enable" CommandPageEnable MethodType = "Page.enable"
CommandPageDisable MethodType = "Page.disable" CommandPageDisable MethodType = "Page.disable"
CommandPageAddScriptToEvaluateOnNewDocument MethodType = "Page.addScriptToEvaluateOnNewDocument" CommandPageAddScriptToEvaluateOnNewDocument MethodType = "Page.addScriptToEvaluateOnNewDocument"
@ -96,8 +95,6 @@ const (
CommandPageHandleJavaScriptDialog MethodType = "Page.handleJavaScriptDialog" CommandPageHandleJavaScriptDialog MethodType = "Page.handleJavaScriptDialog"
CommandPageGetAppManifest MethodType = "Page.getAppManifest" CommandPageGetAppManifest MethodType = "Page.getAppManifest"
CommandPageRequestAppBanner MethodType = "Page.requestAppBanner" CommandPageRequestAppBanner MethodType = "Page.requestAppBanner"
CommandPageSetControlNavigations MethodType = "Page.setControlNavigations"
CommandPageProcessNavigation MethodType = "Page.processNavigation"
CommandPageGetLayoutMetrics MethodType = "Page.getLayoutMetrics" CommandPageGetLayoutMetrics MethodType = "Page.getLayoutMetrics"
CommandPageCreateIsolatedWorld MethodType = "Page.createIsolatedWorld" CommandPageCreateIsolatedWorld MethodType = "Page.createIsolatedWorld"
CommandPageBringToFront MethodType = "Page.bringToFront" CommandPageBringToFront MethodType = "Page.bringToFront"
@ -533,8 +530,6 @@ func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = EventPageInterstitialShown *t = EventPageInterstitialShown
case EventPageInterstitialHidden: case EventPageInterstitialHidden:
*t = EventPageInterstitialHidden *t = EventPageInterstitialHidden
case EventPageNavigationRequested:
*t = EventPageNavigationRequested
case CommandPageEnable: case CommandPageEnable:
*t = CommandPageEnable *t = CommandPageEnable
case CommandPageDisable: case CommandPageDisable:
@ -581,10 +576,6 @@ func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CommandPageGetAppManifest *t = CommandPageGetAppManifest
case CommandPageRequestAppBanner: case CommandPageRequestAppBanner:
*t = CommandPageRequestAppBanner *t = CommandPageRequestAppBanner
case CommandPageSetControlNavigations:
*t = CommandPageSetControlNavigations
case CommandPageProcessNavigation:
*t = CommandPageProcessNavigation
case CommandPageGetLayoutMetrics: case CommandPageGetLayoutMetrics:
*t = CommandPageGetLayoutMetrics *t = CommandPageGetLayoutMetrics
case CommandPageCreateIsolatedWorld: case CommandPageCreateIsolatedWorld:

View File

@ -140,12 +140,6 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
case cdp.CommandPageRequestAppBanner: case cdp.CommandPageRequestAppBanner:
return emptyVal, nil return emptyVal, nil
case cdp.CommandPageSetControlNavigations:
return emptyVal, nil
case cdp.CommandPageProcessNavigation:
return emptyVal, nil
case cdp.CommandPageGetLayoutMetrics: case cdp.CommandPageGetLayoutMetrics:
v = new(page.GetLayoutMetricsReturns) v = new(page.GetLayoutMetricsReturns)
@ -203,9 +197,6 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
case cdp.EventPageInterstitialHidden: case cdp.EventPageInterstitialHidden:
v = new(page.EventInterstitialHidden) v = new(page.EventInterstitialHidden)
case cdp.EventPageNavigationRequested:
v = new(page.EventNavigationRequested)
case cdp.CommandOverlayEnable: case cdp.CommandOverlayEnable:
return emptyVal, nil return emptyVal, nil

View File

@ -695,6 +695,8 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpDomsnapshot4(in *jlexer.Lexer,
out.BaseURL = string(in.String()) out.BaseURL = string(in.String())
case "contentLanguage": case "contentLanguage":
out.ContentLanguage = string(in.String()) out.ContentLanguage = string(in.String())
case "documentEncoding":
out.DocumentEncoding = string(in.String())
case "publicId": case "publicId":
out.PublicID = string(in.String()) out.PublicID = string(in.String())
case "systemId": case "systemId":
@ -874,6 +876,14 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpDomsnapshot4(out *jwriter.Writ
out.RawString("\"contentLanguage\":") out.RawString("\"contentLanguage\":")
out.String(string(in.ContentLanguage)) out.String(string(in.ContentLanguage))
} }
if in.DocumentEncoding != "" {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"documentEncoding\":")
out.String(string(in.DocumentEncoding))
}
if in.PublicID != "" { if in.PublicID != "" {
if !first { if !first {
out.RawByte(',') out.RawByte(',')

View File

@ -25,6 +25,7 @@ type DOMNode struct {
DocumentURL string `json:"documentURL,omitempty"` // Document URL that Document or FrameOwner node points to. DocumentURL string `json:"documentURL,omitempty"` // Document URL that Document or FrameOwner node points to.
BaseURL string `json:"baseURL,omitempty"` // Base URL that Document or FrameOwner node uses for URL completion. BaseURL string `json:"baseURL,omitempty"` // Base URL that Document or FrameOwner node uses for URL completion.
ContentLanguage string `json:"contentLanguage,omitempty"` // Only set for documents, contains the document's content language. ContentLanguage string `json:"contentLanguage,omitempty"` // Only set for documents, contains the document's content language.
DocumentEncoding string `json:"documentEncoding,omitempty"` // Only set for documents, contains the document's character set encoding.
PublicID string `json:"publicId,omitempty"` // DocumentType node's publicId. PublicID string `json:"publicId,omitempty"` // DocumentType node's publicId.
SystemID string `json:"systemId,omitempty"` // DocumentType node's systemId. SystemID string `json:"systemId,omitempty"` // DocumentType node's systemId.
FrameID cdp.FrameID `json:"frameId,omitempty"` // Frame ID for frame owner elements. FrameID cdp.FrameID `json:"frameId,omitempty"` // Frame ID for frame owner elements.

View File

@ -4432,6 +4432,8 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork38(in *jlexer.Lexer, ou
} }
case "resourceType": case "resourceType":
(out.ResourceType).UnmarshalEasyJSON(in) (out.ResourceType).UnmarshalEasyJSON(in)
case "isNavigationRequest":
out.IsNavigationRequest = bool(in.Bool())
case "redirectHeaders": case "redirectHeaders":
if in.IsNull() { if in.IsNull() {
in.Skip() in.Skip()
@ -4508,6 +4510,12 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork38(out *jwriter.Writer,
first = false first = false
out.RawString("\"resourceType\":") out.RawString("\"resourceType\":")
(in.ResourceType).MarshalEasyJSON(out) (in.ResourceType).MarshalEasyJSON(out)
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"isNavigationRequest\":")
out.Bool(bool(in.IsNavigationRequest))
if len(in.RedirectHeaders) != 0 { if len(in.RedirectHeaders) != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')

View File

@ -133,13 +133,14 @@ type EventEventSourceMessageReceived struct {
// EventRequestIntercepted details of an intercepted HTTP request, which must // EventRequestIntercepted details of an intercepted HTTP request, which must
// be either allowed, blocked, modified or mocked. // be either allowed, blocked, modified or mocked.
type EventRequestIntercepted struct { type EventRequestIntercepted struct {
InterceptionID InterceptionID `json:"interceptionId"` // Each request the page makes will have a unique id, however if any redirects are encountered while processing that fetch, they will be reported with the same id as the original fetch. Likewise if HTTP authentication is needed then the same fetch id will be used. InterceptionID InterceptionID `json:"interceptionId"` // Each request the page makes will have a unique id, however if any redirects are encountered while processing that fetch, they will be reported with the same id as the original fetch. Likewise if HTTP authentication is needed then the same fetch id will be used.
Request *Request `json:"request"` Request *Request `json:"request"`
ResourceType page.ResourceType `json:"resourceType"` // How the requested resource will be used. ResourceType page.ResourceType `json:"resourceType"` // How the requested resource will be used.
RedirectHeaders Headers `json:"redirectHeaders,omitempty"` // HTTP response headers, only sent if a redirect was intercepted. IsNavigationRequest bool `json:"isNavigationRequest"` // Whether this is a navigation request, which can abort the navigation completely.
RedirectStatusCode int64 `json:"redirectStatusCode,omitempty"` // HTTP response code, only sent if a redirect was intercepted. RedirectHeaders Headers `json:"redirectHeaders,omitempty"` // HTTP response headers, only sent if a redirect was intercepted.
RedirectURL string `json:"redirectUrl,omitempty"` // Redirect location, only sent if a redirect was intercepted. RedirectStatusCode int64 `json:"redirectStatusCode,omitempty"` // HTTP response code, only sent if a redirect was intercepted.
AuthChallenge *AuthChallenge `json:"authChallenge,omitempty"` // Details of the Authorization Challenge encountered. If this is set then continueInterceptedRequest must contain an authChallengeResponse. RedirectURL string `json:"redirectUrl,omitempty"` // Redirect location, only sent if a redirect was intercepted.
AuthChallenge *AuthChallenge `json:"authChallenge,omitempty"` // Details of the Authorization Challenge encountered. If this is set then continueInterceptedRequest must contain an authChallengeResponse.
} }
// EventTypes all event types in the domain. // EventTypes all event types in the domain.

View File

@ -684,7 +684,7 @@ func (p *SetRequestInterceptionEnabledParams) Do(ctxt context.Context, h cdp.Han
// Network.requestIntercepted event will be sent with the same InterceptionId. // Network.requestIntercepted event will be sent with the same InterceptionId.
type ContinueInterceptedRequestParams struct { type ContinueInterceptedRequestParams struct {
InterceptionID InterceptionID `json:"interceptionId"` InterceptionID InterceptionID `json:"interceptionId"`
ErrorReason ErrorReason `json:"errorReason,omitempty"` // If set this causes the request to fail with the given reason. Must not be set in response to an authChallenge. ErrorReason ErrorReason `json:"errorReason,omitempty"` // If set this causes the request to fail with the given reason. Passing Aborted for requests marked with isNavigationRequest also cancels the navigation. Must not be set in response to an authChallenge.
RawResponse string `json:"rawResponse,omitempty"` // If set the requests completes using with the provided base64 encoded raw response, including HTTP status line and headers etc... Must not be set in response to an authChallenge. RawResponse string `json:"rawResponse,omitempty"` // If set the requests completes using with the provided base64 encoded raw response, including HTTP status line and headers etc... Must not be set in response to an authChallenge.
URL string `json:"url,omitempty"` // If set the request url will be modified in a way that's not observable by page. Must not be set in response to an authChallenge. URL string `json:"url,omitempty"` // If set the request url will be modified in a way that's not observable by page. Must not be set in response to an authChallenge.
Method string `json:"method,omitempty"` // If set this allows the request method to be overridden. Must not be set in response to an authChallenge. Method string `json:"method,omitempty"` // If set this allows the request method to be overridden. Must not be set in response to an authChallenge.
@ -708,7 +708,8 @@ func ContinueInterceptedRequest(interceptionID InterceptionID) *ContinueIntercep
} }
// WithErrorReason if set this causes the request to fail with the given // WithErrorReason if set this causes the request to fail with the given
// reason. Must not be set in response to an authChallenge. // reason. Passing Aborted for requests marked with isNavigationRequest also
// cancels the navigation. Must not be set in response to an authChallenge.
func (p ContinueInterceptedRequestParams) WithErrorReason(errorReason ErrorReason) *ContinueInterceptedRequestParams { func (p ContinueInterceptedRequestParams) WithErrorReason(errorReason ErrorReason) *ContinueInterceptedRequestParams {
p.ErrorReason = errorReason p.ErrorReason = errorReason
return &p return &p

File diff suppressed because it is too large Load Diff

View File

@ -66,14 +66,17 @@ type EventFrameResized struct{}
// EventJavascriptDialogOpening fired when a JavaScript initiated dialog // EventJavascriptDialogOpening fired when a JavaScript initiated dialog
// (alert, confirm, prompt, or onbeforeunload) is about to open. // (alert, confirm, prompt, or onbeforeunload) is about to open.
type EventJavascriptDialogOpening struct { type EventJavascriptDialogOpening struct {
Message string `json:"message"` // Message that will be displayed by the dialog. URL string `json:"url"` // Frame url.
Type DialogType `json:"type"` // Dialog type. Message string `json:"message"` // Message that will be displayed by the dialog.
Type DialogType `json:"type"` // Dialog type.
DefaultPrompt string `json:"defaultPrompt,omitempty"` // Default dialog prompt.
} }
// EventJavascriptDialogClosed fired when a JavaScript initiated dialog // EventJavascriptDialogClosed fired when a JavaScript initiated dialog
// (alert, confirm, prompt, or onbeforeunload) has been closed. // (alert, confirm, prompt, or onbeforeunload) has been closed.
type EventJavascriptDialogClosed struct { type EventJavascriptDialogClosed struct {
Result bool `json:"result"` // Whether dialog was confirmed. Result bool `json:"result"` // Whether dialog was confirmed.
UserInput string `json:"userInput"` // User input in case of prompt.
} }
// EventScreencastFrame compressed image data requested by the // EventScreencastFrame compressed image data requested by the
@ -96,16 +99,6 @@ type EventInterstitialShown struct{}
// EventInterstitialHidden fired when interstitial page was hidden. // EventInterstitialHidden fired when interstitial page was hidden.
type EventInterstitialHidden struct{} type EventInterstitialHidden struct{}
// EventNavigationRequested fired when a navigation is started if navigation
// throttles are enabled. The navigation will be deferred until
// processNavigation is called.
type EventNavigationRequested struct {
IsInMainFrame bool `json:"isInMainFrame"` // Whether the navigation is taking place in the main frame or in a subframe.
IsRedirect bool `json:"isRedirect"` // Whether the navigation has encountered a server redirect or not.
NavigationID int64 `json:"navigationId"`
URL string `json:"url"` // URL of requested navigation.
}
// EventTypes all event types in the domain. // EventTypes all event types in the domain.
var EventTypes = []cdp.MethodType{ var EventTypes = []cdp.MethodType{
cdp.EventPageDomContentEventFired, cdp.EventPageDomContentEventFired,
@ -124,5 +117,4 @@ var EventTypes = []cdp.MethodType{
cdp.EventPageScreencastVisibilityChanged, cdp.EventPageScreencastVisibilityChanged,
cdp.EventPageInterstitialShown, cdp.EventPageInterstitialShown,
cdp.EventPageInterstitialHidden, cdp.EventPageInterstitialHidden,
cdp.EventPageNavigationRequested,
} }

View File

@ -823,56 +823,6 @@ func (p *RequestAppBannerParams) Do(ctxt context.Context, h cdp.Handler) (err er
return h.Execute(ctxt, cdp.CommandPageRequestAppBanner, nil, nil) return h.Execute(ctxt, cdp.CommandPageRequestAppBanner, nil, nil)
} }
// SetControlNavigationsParams toggles navigation throttling which allows
// programatic control over navigation and redirect response.
type SetControlNavigationsParams struct {
Enabled bool `json:"enabled"`
}
// SetControlNavigations toggles navigation throttling which allows
// programatic control over navigation and redirect response.
//
// parameters:
// enabled
func SetControlNavigations(enabled bool) *SetControlNavigationsParams {
return &SetControlNavigationsParams{
Enabled: enabled,
}
}
// Do executes Page.setControlNavigations against the provided context and
// target handler.
func (p *SetControlNavigationsParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandPageSetControlNavigations, p, nil)
}
// ProcessNavigationParams should be sent in response to a
// navigationRequested or a redirectRequested event, telling the browser how to
// handle the navigation.
type ProcessNavigationParams struct {
Response NavigationResponse `json:"response"`
NavigationID int64 `json:"navigationId"`
}
// ProcessNavigation should be sent in response to a navigationRequested or a
// redirectRequested event, telling the browser how to handle the navigation.
//
// parameters:
// response
// navigationID
func ProcessNavigation(response NavigationResponse, navigationID int64) *ProcessNavigationParams {
return &ProcessNavigationParams{
Response: response,
NavigationID: navigationID,
}
}
// Do executes Page.processNavigation against the provided context and
// target handler.
func (p *ProcessNavigationParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandPageProcessNavigation, p, nil)
}
// GetLayoutMetricsParams returns metrics relating to the layouting of the // GetLayoutMetricsParams returns metrics relating to the layouting of the
// page, such as viewport bounds/scale. // page, such as viewport bounds/scale.
type GetLayoutMetricsParams struct{} type GetLayoutMetricsParams struct{}

View File

@ -1228,32 +1228,6 @@
"name": "requestAppBanner", "name": "requestAppBanner",
"experimental": true "experimental": true
}, },
{
"name": "setControlNavigations",
"parameters": [
{
"name": "enabled",
"type": "boolean"
}
],
"description": "Toggles navigation throttling which allows programatic control over navigation and redirect response.",
"experimental": true
},
{
"name": "processNavigation",
"parameters": [
{
"name": "response",
"$ref": "NavigationResponse"
},
{
"name": "navigationId",
"type": "integer"
}
],
"description": "Should be sent in response to a navigationRequested or a redirectRequested event, telling the browser how to handle the navigation.",
"experimental": true
},
{ {
"name": "getLayoutMetrics", "name": "getLayoutMetrics",
"description": "Returns metrics relating to the layouting of the page, such as viewport bounds/scale.", "description": "Returns metrics relating to the layouting of the page, such as viewport bounds/scale.",
@ -1457,6 +1431,11 @@
"name": "javascriptDialogOpening", "name": "javascriptDialogOpening",
"description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.", "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.",
"parameters": [ "parameters": [
{
"name": "url",
"type": "string",
"description": "Frame url."
},
{ {
"name": "message", "name": "message",
"type": "string", "type": "string",
@ -1466,6 +1445,12 @@
"name": "type", "name": "type",
"$ref": "DialogType", "$ref": "DialogType",
"description": "Dialog type." "description": "Dialog type."
},
{
"name": "defaultPrompt",
"optional": true,
"type": "string",
"description": "Default dialog prompt."
} }
] ]
}, },
@ -1477,6 +1462,11 @@
"name": "result", "name": "result",
"type": "boolean", "type": "boolean",
"description": "Whether dialog was confirmed." "description": "Whether dialog was confirmed."
},
{
"name": "userInput",
"type": "string",
"description": "User input in case of prompt."
} }
] ]
}, },
@ -1521,31 +1511,6 @@
{ {
"name": "interstitialHidden", "name": "interstitialHidden",
"description": "Fired when interstitial page was hidden" "description": "Fired when interstitial page was hidden"
},
{
"name": "navigationRequested",
"description": "Fired when a navigation is started if navigation throttles are enabled. The navigation will be deferred until processNavigation is called.",
"parameters": [
{
"name": "isInMainFrame",
"type": "boolean",
"description": "Whether the navigation is taking place in the main frame or in a subframe."
},
{
"name": "isRedirect",
"type": "boolean",
"description": "Whether the navigation has encountered a server redirect or not."
},
{
"name": "navigationId",
"type": "integer"
},
{
"name": "url",
"type": "string",
"description": "URL of requested navigation."
}
]
} }
] ]
}, },
@ -3567,7 +3532,7 @@
"name": "errorReason", "name": "errorReason",
"$ref": "ErrorReason", "$ref": "ErrorReason",
"optional": true, "optional": true,
"description": "If set this causes the request to fail with the given reason. Must not be set in response to an authChallenge." "description": "If set this causes the request to fail with the given reason. Passing <code>Aborted</code> for requests marked with <code>isNavigationRequest</code> also cancels the navigation. Must not be set in response to an authChallenge."
}, },
{ {
"name": "rawResponse", "name": "rawResponse",
@ -4035,6 +4000,11 @@
"$ref": "Page.ResourceType", "$ref": "Page.ResourceType",
"description": "How the requested resource will be used." "description": "How the requested resource will be used."
}, },
{
"name": "isNavigationRequest",
"type": "boolean",
"description": "Whether this is a navigation request, which can abort the navigation completely."
},
{ {
"name": "redirectHeaders", "name": "redirectHeaders",
"$ref": "Headers", "$ref": "Headers",
@ -7708,6 +7678,12 @@
"optional": true, "optional": true,
"description": "Only set for documents, contains the document's content language." "description": "Only set for documents, contains the document's content language."
}, },
{
"name": "documentEncoding",
"type": "string",
"optional": true,
"description": "Only set for documents, contains the document's character set encoding."
},
{ {
"name": "publicId", "name": "publicId",
"type": "string", "type": "string",
@ -10553,6 +10529,7 @@
"id": "AXGlobalStates", "id": "AXGlobalStates",
"type": "string", "type": "string",
"enum": [ "enum": [
"busy",
"disabled", "disabled",
"hidden", "hidden",
"hiddenRoot", "hiddenRoot",
@ -10569,7 +10546,6 @@
"live", "live",
"atomic", "atomic",
"relevant", "relevant",
"busy",
"root" "root"
], ],
"description": "Attributes which apply to nodes in live regions." "description": "Attributes which apply to nodes in live regions."

View File

@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
BROWSER_VER=${1:-"master"}
JS_VER=${2:-"master"}
# updates protocol.json to the latest from the chromium source tree # updates protocol.json to the latest from the chromium source tree
SRC=$(realpath $(cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )) SRC=$(realpath $(cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd ))
@ -7,8 +10,8 @@ SRC=$(realpath $(cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd ))
HAR_PROTO="$SRC/har.json" HAR_PROTO="$SRC/har.json"
BASE_URL="https://chromium.googlesource.com" BASE_URL="https://chromium.googlesource.com"
BROWSER_PROTO="$BASE_URL/chromium/src/+/master/third_party/WebKit/Source/core/inspector/browser_protocol.json?format=TEXT" BROWSER_PROTO="$BASE_URL/chromium/src/+/$BROWSER_VER/third_party/WebKit/Source/core/inspector/browser_protocol.json?format=TEXT"
JS_PROTO="$BASE_URL/v8/v8/+/master/src/inspector/js_protocol.json?format=TEXT" JS_PROTO="$BASE_URL/v8/v8/+/$JS_VER/src/inspector/js_protocol.json?format=TEXT"
OUT=$SRC/protocol.json OUT=$SRC/protocol.json
@ -16,6 +19,9 @@ TMP=$(mktemp -d /tmp/chromedp-gen.XXXXXX)
BROWSER_TMP="$TMP/browser_protocol.json" BROWSER_TMP="$TMP/browser_protocol.json"
JS_TMP="$TMP/js_protocol.json" JS_TMP="$TMP/js_protocol.json"
echo "BROWSER_PROTO: $BROWSER_PROTO"
echo "JS_PROTO: $JS_PROTO"
set -ve set -ve
# download # download
curl -s $BROWSER_PROTO | base64 -d > $BROWSER_TMP curl -s $BROWSER_PROTO | base64 -d > $BROWSER_TMP