Updating to 140.0.7316.1_14.0.303 definitions
diff --git a/cdproto.go b/cdproto.go
index 5bfbad6..07ff366 100644
--- a/cdproto.go
+++ b/cdproto.go
@@ -179,6 +179,7 @@
CommandCSSGetInlineStylesForNode = css.CommandGetInlineStylesForNode
CommandCSSGetAnimatedStylesForNode = css.CommandGetAnimatedStylesForNode
CommandCSSGetMatchedStylesForNode = css.CommandGetMatchedStylesForNode
+ CommandCSSGetEnvironmentVariables = css.CommandGetEnvironmentVariables
CommandCSSGetMediaQueries = css.CommandGetMediaQueries
CommandCSSGetPlatformFontsForNode = css.CommandGetPlatformFontsForNode
CommandCSSGetStyleSheetText = css.CommandGetStyleSheetText
@@ -1102,6 +1103,8 @@
v = new(css.GetAnimatedStylesForNodeReturns)
case CommandCSSGetMatchedStylesForNode:
v = new(css.GetMatchedStylesForNodeReturns)
+ case CommandCSSGetEnvironmentVariables:
+ v = new(css.GetEnvironmentVariablesReturns)
case CommandCSSGetMediaQueries:
v = new(css.GetMediaQueriesReturns)
case CommandCSSGetPlatformFontsForNode:
diff --git a/css/css.go b/css/css.go
index 981866b..e38254d 100644
--- a/css/css.go
+++ b/css/css.go
@@ -19,6 +19,7 @@
"context"
"github.com/chromedp/cdproto/cdp"
+ "github.com/go-json-experiment/json/jsontext"
)
// AddRuleParams inserts a new rule with the given ruleText in a stylesheet
@@ -622,6 +623,39 @@
return res.InlineStyle, res.AttributesStyle, res.MatchedCSSRules, res.PseudoElements, res.Inherited, res.InheritedPseudoElements, res.CSSKeyframesRules, res.CSSPositionTryRules, res.ActivePositionFallbackIndex, res.CSSPropertyRules, res.CSSPropertyRegistrations, res.CSSFontPaletteValuesRule, res.ParentLayoutNodeID, res.CSSFunctionRules, nil
}
+// GetEnvironmentVariablesParams returns the values of the default UA-defined
+// environment variables used in env().
+type GetEnvironmentVariablesParams struct{}
+
+// GetEnvironmentVariables returns the values of the default UA-defined
+// environment variables used in env().
+//
+// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-getEnvironmentVariables
+func GetEnvironmentVariables() *GetEnvironmentVariablesParams {
+ return &GetEnvironmentVariablesParams{}
+}
+
+// GetEnvironmentVariablesReturns return values.
+type GetEnvironmentVariablesReturns struct {
+ EnvironmentVariables jsontext.Value `json:"environmentVariables,omitempty,omitzero"`
+}
+
+// Do executes CSS.getEnvironmentVariables against the provided context.
+//
+// returns:
+//
+// environmentVariables
+func (p *GetEnvironmentVariablesParams) Do(ctx context.Context) (environmentVariables jsontext.Value, err error) {
+ // execute
+ var res GetEnvironmentVariablesReturns
+ err = cdp.Execute(ctx, CommandGetEnvironmentVariables, nil, &res)
+ if err != nil {
+ return nil, err
+ }
+
+ return res.EnvironmentVariables, nil
+}
+
// GetMediaQueriesParams returns all media queries parsed by the rendering
// engine.
type GetMediaQueriesParams struct{}
@@ -1497,6 +1531,7 @@
CommandGetInlineStylesForNode = "CSS.getInlineStylesForNode"
CommandGetAnimatedStylesForNode = "CSS.getAnimatedStylesForNode"
CommandGetMatchedStylesForNode = "CSS.getMatchedStylesForNode"
+ CommandGetEnvironmentVariables = "CSS.getEnvironmentVariables"
CommandGetMediaQueries = "CSS.getMediaQueries"
CommandGetPlatformFontsForNode = "CSS.getPlatformFontsForNode"
CommandGetStyleSheetText = "CSS.getStyleSheetText"
diff --git a/network/types.go b/network/types.go
index 457b2f1..058f04c 100644
--- a/network/types.go
+++ b/network/types.go
@@ -949,6 +949,7 @@
AlternateProtocolUsage AlternateProtocolUsage `json:"alternateProtocolUsage,omitempty,omitzero"` // The reason why Chrome uses a specific transport protocol for HTTP semantics.
SecurityState security.State `json:"securityState"` // Security state of the request resource.
SecurityDetails *SecurityDetails `json:"securityDetails,omitempty,omitzero"` // Security details for the request.
+ IsIPProtectionUsed bool `json:"isIpProtectionUsed"` // Indicates whether the request was sent through IP Protection proxies. If set to true, the request used the IP Protection privacy feature.
}
// WebSocketRequest webSocket request data.
@@ -1659,7 +1660,7 @@
// IPAddressSpace values.
const (
IPAddressSpaceLoopback IPAddressSpace = "Loopback"
- IPAddressSpacePrivate IPAddressSpace = "Private"
+ IPAddressSpaceLocal IPAddressSpace = "Local"
IPAddressSpacePublic IPAddressSpace = "Public"
IPAddressSpaceUnknown IPAddressSpace = "Unknown"
)
@@ -1672,8 +1673,8 @@
switch IPAddressSpace(s) {
case IPAddressSpaceLoopback:
*t = IPAddressSpaceLoopback
- case IPAddressSpacePrivate:
- *t = IPAddressSpacePrivate
+ case IPAddressSpaceLocal:
+ *t = IPAddressSpaceLocal
case IPAddressSpacePublic:
*t = IPAddressSpacePublic
case IPAddressSpaceUnknown:
diff --git a/page/page.go b/page/page.go
index 3d71094..f381d00 100644
--- a/page/page.go
+++ b/page/page.go
@@ -785,9 +785,10 @@
// NavigateReturns return values.
type NavigateReturns struct {
- FrameID cdp.FrameID `json:"frameId,omitempty,omitzero"` // Frame id that has navigated (or failed to navigate)
- LoaderID cdp.LoaderID `json:"loaderId,omitempty,omitzero"` // Loader identifier. This is omitted in case of same-document navigation, as the previously committed loaderId would not change.
- ErrorText string `json:"errorText,omitempty,omitzero"` // User friendly error message, present if and only if navigation has failed.
+ FrameID cdp.FrameID `json:"frameId,omitempty,omitzero"` // Frame id that has navigated (or failed to navigate)
+ LoaderID cdp.LoaderID `json:"loaderId,omitempty,omitzero"` // Loader identifier. This is omitted in case of same-document navigation, as the previously committed loaderId would not change.
+ ErrorText string `json:"errorText,omitempty,omitzero"` // User friendly error message, present if and only if navigation has failed.
+ IsDownload bool `json:"isDownload"` // Whether the navigation resulted in a download.
}
// Do executes Page.navigate against the provided context.
@@ -797,15 +798,16 @@
// frameID - Frame id that has navigated (or failed to navigate)
// loaderID - Loader identifier. This is omitted in case of same-document navigation, as the previously committed loaderId would not change.
// errorText - User friendly error message, present if and only if navigation has failed.
-func (p *NavigateParams) Do(ctx context.Context) (frameID cdp.FrameID, loaderID cdp.LoaderID, errorText string, err error) {
+// isDownload - Whether the navigation resulted in a download.
+func (p *NavigateParams) Do(ctx context.Context) (frameID cdp.FrameID, loaderID cdp.LoaderID, errorText string, isDownload bool, err error) {
// execute
var res NavigateReturns
err = cdp.Execute(ctx, CommandNavigate, p, &res)
if err != nil {
- return "", "", "", err
+ return "", "", "", false, err
}
- return res.FrameID, res.LoaderID, res.ErrorText, nil
+ return res.FrameID, res.LoaderID, res.ErrorText, res.IsDownload, nil
}
// NavigateToHistoryEntryParams navigates current page to the given history
diff --git a/preload/types.go b/preload/types.go
index ee9e2d5..cc5a685 100644
--- a/preload/types.go
+++ b/preload/types.go
@@ -45,8 +45,9 @@
// RuleSetErrorType values.
const (
- RuleSetErrorTypeSourceIsNotJSONObject RuleSetErrorType = "SourceIsNotJsonObject"
- RuleSetErrorTypeInvalidRulesSkipped RuleSetErrorType = "InvalidRulesSkipped"
+ RuleSetErrorTypeSourceIsNotJSONObject RuleSetErrorType = "SourceIsNotJsonObject"
+ RuleSetErrorTypeInvalidRulesSkipped RuleSetErrorType = "InvalidRulesSkipped"
+ RuleSetErrorTypeInvalidRulesetLevelTag RuleSetErrorType = "InvalidRulesetLevelTag"
)
// UnmarshalJSON satisfies [json.Unmarshaler].
@@ -59,6 +60,8 @@
*t = RuleSetErrorTypeSourceIsNotJSONObject
case RuleSetErrorTypeInvalidRulesSkipped:
*t = RuleSetErrorTypeInvalidRulesSkipped
+ case RuleSetErrorTypeInvalidRulesetLevelTag:
+ *t = RuleSetErrorTypeInvalidRulesetLevelTag
default:
return fmt.Errorf("unknown RuleSetErrorType value: %v", s)
}