// Package css provides the Chrome DevTools Protocol// commands, types, and events for the CSS domain.//// This domain exposes CSS read/write operations. All CSS objects// (stylesheets, rules, and styles) have an associated id used in subsequent// operations on the related object. Each object type has a specific id// structure, and those are not interchangeable between objects of different// kinds. CSS objects can be loaded using the get*ForNode() calls (which accept// a DOM node id). A client can also keep track of stylesheets via the// styleSheetAdded/styleSheetRemoved events and subsequently load the required// stylesheet contents using the getStyleSheet[Text]() methods.//// Generated by the cdproto-gen command.
package css// Code generated by cdproto-gen. DO NOT EDIT.import ()// AddRuleParams inserts a new rule with the given ruleText in a stylesheet// with given styleSheetId, at the position specified by location.typeAddRuleParamsstruct { StyleSheetID StyleSheetID`json:"styleSheetId"`// The css style sheet identifier where a new rule should be inserted. RuleText string`json:"ruleText"`// The text of a new rule. Location *SourceRange`json:"location"`// Text position of a new rule in the target style sheet.}// AddRule inserts a new rule with the given ruleText in a stylesheet with// given styleSheetId, at the position specified by location.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-addRule//// parameters://// styleSheetID - The css style sheet identifier where a new rule should be inserted.// ruleText - The text of a new rule.// location - Text position of a new rule in the target style sheet.func ( StyleSheetID, string, *SourceRange) *AddRuleParams {return &AddRuleParams{StyleSheetID: ,RuleText: ,Location: , }}// AddRuleReturns return values.typeAddRuleReturnsstruct { Rule *Rule`json:"rule,omitempty"`// The newly created rule.}// Do executes CSS.addRule against the provided context.//// returns://// rule - The newly created rule.func ( *AddRuleParams) ( context.Context) ( *Rule, error) {// executevarAddRuleReturns = cdp.Execute(, CommandAddRule, , &)if != nil {returnnil, }return .Rule, nil}// CollectClassNamesParams returns all class names from specified stylesheet.typeCollectClassNamesParamsstruct { StyleSheetID StyleSheetID`json:"styleSheetId"`}// CollectClassNames returns all class names from specified stylesheet.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-collectClassNames//// parameters://// styleSheetIDfunc ( StyleSheetID) *CollectClassNamesParams {return &CollectClassNamesParams{StyleSheetID: , }}// CollectClassNamesReturns return values.typeCollectClassNamesReturnsstruct { ClassNames []string`json:"classNames,omitempty"`// Class name list.}// Do executes CSS.collectClassNames against the provided context.//// returns://// classNames - Class name list.func ( *CollectClassNamesParams) ( context.Context) ( []string, error) {// executevarCollectClassNamesReturns = cdp.Execute(, CommandCollectClassNames, , &)if != nil {returnnil, }return .ClassNames, nil}// CreateStyleSheetParams creates a new special "via-inspector" stylesheet in// the frame with given frameId.typeCreateStyleSheetParamsstruct { FrameID cdp.FrameID`json:"frameId"`// Identifier of the frame where "via-inspector" stylesheet should be created.}// CreateStyleSheet creates a new special "via-inspector" stylesheet in the// frame with given frameId.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-createStyleSheet//// parameters://// frameID - Identifier of the frame where "via-inspector" stylesheet should be created.func ( cdp.FrameID) *CreateStyleSheetParams {return &CreateStyleSheetParams{FrameID: , }}// CreateStyleSheetReturns return values.typeCreateStyleSheetReturnsstruct { StyleSheetID StyleSheetID`json:"styleSheetId,omitempty"`// Identifier of the created "via-inspector" stylesheet.}// Do executes CSS.createStyleSheet against the provided context.//// returns://// styleSheetID - Identifier of the created "via-inspector" stylesheet.func ( *CreateStyleSheetParams) ( context.Context) ( StyleSheetID, error) {// executevarCreateStyleSheetReturns = cdp.Execute(, CommandCreateStyleSheet, , &)if != nil {return"", }return .StyleSheetID, nil}// DisableParams disables the CSS agent for the given page.typeDisableParamsstruct{}// Disable disables the CSS agent for the given page.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-disablefunc () *DisableParams {return &DisableParams{}}// Do executes CSS.disable against the provided context.func ( *DisableParams) ( context.Context) ( error) {returncdp.Execute(, CommandDisable, nil, nil)}// EnableParams enables the CSS agent for the given page. Clients should not// assume that the CSS agent has been enabled until the result of this command// is received.typeEnableParamsstruct{}// Enable enables the CSS agent for the given page. Clients should not assume// that the CSS agent has been enabled until the result of this command is// received.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-enablefunc () *EnableParams {return &EnableParams{}}// Do executes CSS.enable against the provided context.func ( *EnableParams) ( context.Context) ( error) {returncdp.Execute(, CommandEnable, nil, nil)}// ForcePseudoStateParams ensures that the given node will have specified// pseudo-classes whenever its style is computed by the browser.typeForcePseudoStateParamsstruct { NodeID cdp.NodeID`json:"nodeId"`// The element id for which to force the pseudo state. ForcedPseudoClasses []string`json:"forcedPseudoClasses"`// Element pseudo classes to force when computing the element's style.}// ForcePseudoState ensures that the given node will have specified// pseudo-classes whenever its style is computed by the browser.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-forcePseudoState//// parameters://// nodeID - The element id for which to force the pseudo state.// forcedPseudoClasses - Element pseudo classes to force when computing the element's style.func ( cdp.NodeID, []string) *ForcePseudoStateParams {return &ForcePseudoStateParams{NodeID: ,ForcedPseudoClasses: , }}// Do executes CSS.forcePseudoState against the provided context.func ( *ForcePseudoStateParams) ( context.Context) ( error) {returncdp.Execute(, CommandForcePseudoState, , nil)}// GetBackgroundColorsParams [no description].typeGetBackgroundColorsParamsstruct { NodeID cdp.NodeID`json:"nodeId"`// Id of the node to get background colors for.}// GetBackgroundColors [no description].//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-getBackgroundColors//// parameters://// nodeID - Id of the node to get background colors for.func ( cdp.NodeID) *GetBackgroundColorsParams {return &GetBackgroundColorsParams{NodeID: , }}// GetBackgroundColorsReturns return values.typeGetBackgroundColorsReturnsstruct { BackgroundColors []string`json:"backgroundColors,omitempty"`// The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load). ComputedFontSize string`json:"computedFontSize,omitempty"`// The computed font size for this node, as a CSS computed value string (e.g. '12px'). ComputedFontWeight string`json:"computedFontWeight,omitempty"`// The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100').}// Do executes CSS.getBackgroundColors against the provided context.//// returns://// backgroundColors - The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load).// computedFontSize - The computed font size for this node, as a CSS computed value string (e.g. '12px').// computedFontWeight - The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100').func ( *GetBackgroundColorsParams) ( context.Context) ( []string, string, string, error) {// executevarGetBackgroundColorsReturns = cdp.Execute(, CommandGetBackgroundColors, , &)if != nil {returnnil, "", "", }return .BackgroundColors, .ComputedFontSize, .ComputedFontWeight, nil}// GetComputedStyleForNodeParams returns the computed style for a DOM node// identified by nodeId.typeGetComputedStyleForNodeParamsstruct { NodeID cdp.NodeID`json:"nodeId"`}// GetComputedStyleForNode returns the computed style for a DOM node// identified by nodeId.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-getComputedStyleForNode//// parameters://// nodeIDfunc ( cdp.NodeID) *GetComputedStyleForNodeParams {return &GetComputedStyleForNodeParams{NodeID: , }}// GetComputedStyleForNodeReturns return values.typeGetComputedStyleForNodeReturnsstruct { ComputedStyle []*ComputedStyleProperty`json:"computedStyle,omitempty"`// Computed style for the specified DOM node.}// Do executes CSS.getComputedStyleForNode against the provided context.//// returns://// computedStyle - Computed style for the specified DOM node.func ( *GetComputedStyleForNodeParams) ( context.Context) ( []*ComputedStyleProperty, error) {// executevarGetComputedStyleForNodeReturns = cdp.Execute(, CommandGetComputedStyleForNode, , &)if != nil {returnnil, }return .ComputedStyle, nil}// GetInlineStylesForNodeParams returns the styles defined inline (explicitly// in the "style" attribute and implicitly, using DOM attributes) for a DOM node// identified by nodeId.typeGetInlineStylesForNodeParamsstruct { NodeID cdp.NodeID`json:"nodeId"`}// GetInlineStylesForNode returns the styles defined inline (explicitly in// the "style" attribute and implicitly, using DOM attributes) for a DOM node// identified by nodeId.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-getInlineStylesForNode//// parameters://// nodeIDfunc ( cdp.NodeID) *GetInlineStylesForNodeParams {return &GetInlineStylesForNodeParams{NodeID: , }}// GetInlineStylesForNodeReturns return values.typeGetInlineStylesForNodeReturnsstruct { InlineStyle *Style`json:"inlineStyle,omitempty"`// Inline style for the specified DOM node. AttributesStyle *Style`json:"attributesStyle,omitempty"`// Attribute-defined element style (e.g. resulting from "width=20 height=100%").}// Do executes CSS.getInlineStylesForNode against the provided context.//// returns://// inlineStyle - Inline style for the specified DOM node.// attributesStyle - Attribute-defined element style (e.g. resulting from "width=20 height=100%").func ( *GetInlineStylesForNodeParams) ( context.Context) ( *Style, *Style, error) {// executevarGetInlineStylesForNodeReturns = cdp.Execute(, CommandGetInlineStylesForNode, , &)if != nil {returnnil, nil, }return .InlineStyle, .AttributesStyle, nil}// GetMatchedStylesForNodeParams returns requested styles for a DOM node// identified by nodeId.typeGetMatchedStylesForNodeParamsstruct { NodeID cdp.NodeID`json:"nodeId"`}// GetMatchedStylesForNode returns requested styles for a DOM node identified// by nodeId.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-getMatchedStylesForNode//// parameters://// nodeIDfunc ( cdp.NodeID) *GetMatchedStylesForNodeParams {return &GetMatchedStylesForNodeParams{NodeID: , }}// GetMatchedStylesForNodeReturns return values.typeGetMatchedStylesForNodeReturnsstruct { InlineStyle *Style`json:"inlineStyle,omitempty"`// Inline style for the specified DOM node. AttributesStyle *Style`json:"attributesStyle,omitempty"`// Attribute-defined element style (e.g. resulting from "width=20 height=100%"). MatchedCSSRules []*RuleMatch`json:"matchedCSSRules,omitempty"`// CSS rules matching this node, from all applicable stylesheets. PseudoElements []*PseudoElementMatches`json:"pseudoElements,omitempty"`// Pseudo style matches for this node. Inherited []*InheritedStyleEntry`json:"inherited,omitempty"`// A chain of inherited styles (from the immediate node parent up to the DOM tree root). InheritedPseudoElements []*InheritedPseudoElementMatches`json:"inheritedPseudoElements,omitempty"`// A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root). CSSKeyframesRules []*KeyframesRule`json:"cssKeyframesRules,omitempty"`// A list of CSS keyframed animations matching this node. CSSPositionFallbackRules []*PositionFallbackRule`json:"cssPositionFallbackRules,omitempty"`// A list of CSS position fallbacks matching this node. CSSPropertyRules []*PropertyRule`json:"cssPropertyRules,omitempty"`// A list of CSS at-property rules matching this node. CSSPropertyRegistrations []*PropertyRegistration`json:"cssPropertyRegistrations,omitempty"`// A list of CSS property registrations matching this node. ParentLayoutNodeID cdp.NodeID`json:"parentLayoutNodeId,omitempty"`// Id of the first parent element that does not have display: contents.}// Do executes CSS.getMatchedStylesForNode against the provided context.//// returns://// inlineStyle - Inline style for the specified DOM node.// attributesStyle - Attribute-defined element style (e.g. resulting from "width=20 height=100%").// matchedCSSRules - CSS rules matching this node, from all applicable stylesheets.// pseudoElements - Pseudo style matches for this node.// inherited - A chain of inherited styles (from the immediate node parent up to the DOM tree root).// inheritedPseudoElements - A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root).// cssKeyframesRules - A list of CSS keyframed animations matching this node.// cssPositionFallbackRules - A list of CSS position fallbacks matching this node.// cssPropertyRules - A list of CSS at-property rules matching this node.// cssPropertyRegistrations - A list of CSS property registrations matching this node.// parentLayoutNodeID - Id of the first parent element that does not have display: contents.func ( *GetMatchedStylesForNodeParams) ( context.Context) ( *Style, *Style, []*RuleMatch, []*PseudoElementMatches, []*InheritedStyleEntry, []*InheritedPseudoElementMatches, []*KeyframesRule, []*PositionFallbackRule, []*PropertyRule, []*PropertyRegistration, cdp.NodeID, error) {// executevarGetMatchedStylesForNodeReturns = cdp.Execute(, CommandGetMatchedStylesForNode, , &)if != nil {returnnil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0, }return .InlineStyle, .AttributesStyle, .MatchedCSSRules, .PseudoElements, .Inherited, .InheritedPseudoElements, .CSSKeyframesRules, .CSSPositionFallbackRules, .CSSPropertyRules, .CSSPropertyRegistrations, .ParentLayoutNodeID, nil}// GetMediaQueriesParams returns all media queries parsed by the rendering// engine.typeGetMediaQueriesParamsstruct{}// GetMediaQueries returns all media queries parsed by the rendering engine.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-getMediaQueriesfunc () *GetMediaQueriesParams {return &GetMediaQueriesParams{}}// GetMediaQueriesReturns return values.typeGetMediaQueriesReturnsstruct { Medias []*Media`json:"medias,omitempty"`}// Do executes CSS.getMediaQueries against the provided context.//// returns://// mediasfunc ( *GetMediaQueriesParams) ( context.Context) ( []*Media, error) {// executevarGetMediaQueriesReturns = cdp.Execute(, CommandGetMediaQueries, nil, &)if != nil {returnnil, }return .Medias, nil}// GetPlatformFontsForNodeParams requests information about platform fonts// which we used to render child TextNodes in the given node.typeGetPlatformFontsForNodeParamsstruct { NodeID cdp.NodeID`json:"nodeId"`}// GetPlatformFontsForNode requests information about platform fonts which we// used to render child TextNodes in the given node.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-getPlatformFontsForNode//// parameters://// nodeIDfunc ( cdp.NodeID) *GetPlatformFontsForNodeParams {return &GetPlatformFontsForNodeParams{NodeID: , }}// GetPlatformFontsForNodeReturns return values.typeGetPlatformFontsForNodeReturnsstruct { Fonts []*PlatformFontUsage`json:"fonts,omitempty"`// Usage statistics for every employed platform font.}// Do executes CSS.getPlatformFontsForNode against the provided context.//// returns://// fonts - Usage statistics for every employed platform font.func ( *GetPlatformFontsForNodeParams) ( context.Context) ( []*PlatformFontUsage, error) {// executevarGetPlatformFontsForNodeReturns = cdp.Execute(, CommandGetPlatformFontsForNode, , &)if != nil {returnnil, }return .Fonts, nil}// GetStyleSheetTextParams returns the current textual content for a// stylesheet.typeGetStyleSheetTextParamsstruct { StyleSheetID StyleSheetID`json:"styleSheetId"`}// GetStyleSheetText returns the current textual content for a stylesheet.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-getStyleSheetText//// parameters://// styleSheetIDfunc ( StyleSheetID) *GetStyleSheetTextParams {return &GetStyleSheetTextParams{StyleSheetID: , }}// GetStyleSheetTextReturns return values.typeGetStyleSheetTextReturnsstruct { Text string`json:"text,omitempty"`// The stylesheet text.}// Do executes CSS.getStyleSheetText against the provided context.//// returns://// text - The stylesheet text.func ( *GetStyleSheetTextParams) ( context.Context) ( string, error) {// executevarGetStyleSheetTextReturns = cdp.Execute(, CommandGetStyleSheetText, , &)if != nil {return"", }return .Text, nil}// GetLayersForNodeParams returns all layers parsed by the rendering engine// for the tree scope of a node. Given a DOM element identified by nodeId,// getLayersForNode returns the root layer for the nearest ancestor document or// shadow root. The layer root contains the full layer tree for the tree scope// and their ordering.typeGetLayersForNodeParamsstruct { NodeID cdp.NodeID`json:"nodeId"`}// GetLayersForNode returns all layers parsed by the rendering engine for the// tree scope of a node. Given a DOM element identified by nodeId,// getLayersForNode returns the root layer for the nearest ancestor document or// shadow root. The layer root contains the full layer tree for the tree scope// and their ordering.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-getLayersForNode//// parameters://// nodeIDfunc ( cdp.NodeID) *GetLayersForNodeParams {return &GetLayersForNodeParams{NodeID: , }}// GetLayersForNodeReturns return values.typeGetLayersForNodeReturnsstruct { RootLayer *LayerData`json:"rootLayer,omitempty"`}// Do executes CSS.getLayersForNode against the provided context.//// returns://// rootLayerfunc ( *GetLayersForNodeParams) ( context.Context) ( *LayerData, error) {// executevarGetLayersForNodeReturns = cdp.Execute(, CommandGetLayersForNode, , &)if != nil {returnnil, }return .RootLayer, nil}// TrackComputedStyleUpdatesParams starts tracking the given computed styles// for updates. The specified array of properties replaces the one previously// specified. Pass empty array to disable tracking. Use takeComputedStyleUpdates// to retrieve the list of nodes that had properties modified. The changes to// computed style properties are only tracked for nodes pushed to the front-end// by the DOM agent. If no changes to the tracked properties occur after the// node has been pushed to the front-end, no updates will be issued for the// node.typeTrackComputedStyleUpdatesParamsstruct { PropertiesToTrack []*ComputedStyleProperty`json:"propertiesToTrack"`}// TrackComputedStyleUpdates starts tracking the given computed styles for// updates. The specified array of properties replaces the one previously// specified. Pass empty array to disable tracking. Use takeComputedStyleUpdates// to retrieve the list of nodes that had properties modified. The changes to// computed style properties are only tracked for nodes pushed to the front-end// by the DOM agent. If no changes to the tracked properties occur after the// node has been pushed to the front-end, no updates will be issued for the// node.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-trackComputedStyleUpdates//// parameters://// propertiesToTrackfunc ( []*ComputedStyleProperty) *TrackComputedStyleUpdatesParams {return &TrackComputedStyleUpdatesParams{PropertiesToTrack: , }}// Do executes CSS.trackComputedStyleUpdates against the provided context.func ( *TrackComputedStyleUpdatesParams) ( context.Context) ( error) {returncdp.Execute(, CommandTrackComputedStyleUpdates, , nil)}// TakeComputedStyleUpdatesParams polls the next batch of computed style// updates.typeTakeComputedStyleUpdatesParamsstruct{}// TakeComputedStyleUpdates polls the next batch of computed style updates.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-takeComputedStyleUpdatesfunc () *TakeComputedStyleUpdatesParams {return &TakeComputedStyleUpdatesParams{}}// TakeComputedStyleUpdatesReturns return values.typeTakeComputedStyleUpdatesReturnsstruct { NodeIDs []cdp.NodeID`json:"nodeIds,omitempty"`// The list of node Ids that have their tracked computed styles updated.}// Do executes CSS.takeComputedStyleUpdates against the provided context.//// returns://// nodeIDs - The list of node Ids that have their tracked computed styles updated.func ( *TakeComputedStyleUpdatesParams) ( context.Context) ( []cdp.NodeID, error) {// executevarTakeComputedStyleUpdatesReturns = cdp.Execute(, CommandTakeComputedStyleUpdates, nil, &)if != nil {returnnil, }return .NodeIDs, nil}// SetEffectivePropertyValueForNodeParams find a rule with the given active// property for the given node and set the new value for this property.typeSetEffectivePropertyValueForNodeParamsstruct { NodeID cdp.NodeID`json:"nodeId"`// The element id for which to set property. PropertyName string`json:"propertyName"` Value string`json:"value"`}// SetEffectivePropertyValueForNode find a rule with the given active// property for the given node and set the new value for this property.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setEffectivePropertyValueForNode//// parameters://// nodeID - The element id for which to set property.// propertyName// valuefunc ( cdp.NodeID, string, string) *SetEffectivePropertyValueForNodeParams {return &SetEffectivePropertyValueForNodeParams{NodeID: ,PropertyName: ,Value: , }}// Do executes CSS.setEffectivePropertyValueForNode against the provided context.func ( *SetEffectivePropertyValueForNodeParams) ( context.Context) ( error) {returncdp.Execute(, CommandSetEffectivePropertyValueForNode, , nil)}// SetPropertyRulePropertyNameParams modifies the property rule property// name.typeSetPropertyRulePropertyNameParamsstruct { StyleSheetID StyleSheetID`json:"styleSheetId"` Range *SourceRange`json:"range"` PropertyName string`json:"propertyName"`}// SetPropertyRulePropertyName modifies the property rule property name.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setPropertyRulePropertyName//// parameters://// styleSheetID// range// propertyNamefunc ( StyleSheetID, *SourceRange, string) *SetPropertyRulePropertyNameParams {return &SetPropertyRulePropertyNameParams{StyleSheetID: ,Range: ,PropertyName: , }}// SetPropertyRulePropertyNameReturns return values.typeSetPropertyRulePropertyNameReturnsstruct { PropertyName *Value`json:"propertyName,omitempty"`// The resulting key text after modification.}// Do executes CSS.setPropertyRulePropertyName against the provided context.//// returns://// propertyName - The resulting key text after modification.func ( *SetPropertyRulePropertyNameParams) ( context.Context) ( *Value, error) {// executevarSetPropertyRulePropertyNameReturns = cdp.Execute(, CommandSetPropertyRulePropertyName, , &)if != nil {returnnil, }return .PropertyName, nil}// SetKeyframeKeyParams modifies the keyframe rule key text.typeSetKeyframeKeyParamsstruct { StyleSheetID StyleSheetID`json:"styleSheetId"` Range *SourceRange`json:"range"` KeyText string`json:"keyText"`}// SetKeyframeKey modifies the keyframe rule key text.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setKeyframeKey//// parameters://// styleSheetID// range// keyTextfunc ( StyleSheetID, *SourceRange, string) *SetKeyframeKeyParams {return &SetKeyframeKeyParams{StyleSheetID: ,Range: ,KeyText: , }}// SetKeyframeKeyReturns return values.typeSetKeyframeKeyReturnsstruct { KeyText *Value`json:"keyText,omitempty"`// The resulting key text after modification.}// Do executes CSS.setKeyframeKey against the provided context.//// returns://// keyText - The resulting key text after modification.func ( *SetKeyframeKeyParams) ( context.Context) ( *Value, error) {// executevarSetKeyframeKeyReturns = cdp.Execute(, CommandSetKeyframeKey, , &)if != nil {returnnil, }return .KeyText, nil}// SetMediaTextParams modifies the rule selector.typeSetMediaTextParamsstruct { StyleSheetID StyleSheetID`json:"styleSheetId"` Range *SourceRange`json:"range"` Text string`json:"text"`}// SetMediaText modifies the rule selector.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setMediaText//// parameters://// styleSheetID// range// textfunc ( StyleSheetID, *SourceRange, string) *SetMediaTextParams {return &SetMediaTextParams{StyleSheetID: ,Range: ,Text: , }}// SetMediaTextReturns return values.typeSetMediaTextReturnsstruct { Media *Media`json:"media,omitempty"`// The resulting CSS media rule after modification.}// Do executes CSS.setMediaText against the provided context.//// returns://// media - The resulting CSS media rule after modification.func ( *SetMediaTextParams) ( context.Context) ( *Media, error) {// executevarSetMediaTextReturns = cdp.Execute(, CommandSetMediaText, , &)if != nil {returnnil, }return .Media, nil}// SetContainerQueryTextParams modifies the expression of a container query.typeSetContainerQueryTextParamsstruct { StyleSheetID StyleSheetID`json:"styleSheetId"` Range *SourceRange`json:"range"` Text string`json:"text"`}// SetContainerQueryText modifies the expression of a container query.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setContainerQueryText//// parameters://// styleSheetID// range// textfunc ( StyleSheetID, *SourceRange, string) *SetContainerQueryTextParams {return &SetContainerQueryTextParams{StyleSheetID: ,Range: ,Text: , }}// SetContainerQueryTextReturns return values.typeSetContainerQueryTextReturnsstruct { ContainerQuery *ContainerQuery`json:"containerQuery,omitempty"`// The resulting CSS container query rule after modification.}// Do executes CSS.setContainerQueryText against the provided context.//// returns://// containerQuery - The resulting CSS container query rule after modification.func ( *SetContainerQueryTextParams) ( context.Context) ( *ContainerQuery, error) {// executevarSetContainerQueryTextReturns = cdp.Execute(, CommandSetContainerQueryText, , &)if != nil {returnnil, }return .ContainerQuery, nil}// SetSupportsTextParams modifies the expression of a supports at-rule.typeSetSupportsTextParamsstruct { StyleSheetID StyleSheetID`json:"styleSheetId"` Range *SourceRange`json:"range"` Text string`json:"text"`}// SetSupportsText modifies the expression of a supports at-rule.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setSupportsText//// parameters://// styleSheetID// range// textfunc ( StyleSheetID, *SourceRange, string) *SetSupportsTextParams {return &SetSupportsTextParams{StyleSheetID: ,Range: ,Text: , }}// SetSupportsTextReturns return values.typeSetSupportsTextReturnsstruct { Supports *Supports`json:"supports,omitempty"`// The resulting CSS Supports rule after modification.}// Do executes CSS.setSupportsText against the provided context.//// returns://// supports - The resulting CSS Supports rule after modification.func ( *SetSupportsTextParams) ( context.Context) ( *Supports, error) {// executevarSetSupportsTextReturns = cdp.Execute(, CommandSetSupportsText, , &)if != nil {returnnil, }return .Supports, nil}// SetScopeTextParams modifies the expression of a scope at-rule.typeSetScopeTextParamsstruct { StyleSheetID StyleSheetID`json:"styleSheetId"` Range *SourceRange`json:"range"` Text string`json:"text"`}// SetScopeText modifies the expression of a scope at-rule.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setScopeText//// parameters://// styleSheetID// range// textfunc ( StyleSheetID, *SourceRange, string) *SetScopeTextParams {return &SetScopeTextParams{StyleSheetID: ,Range: ,Text: , }}// SetScopeTextReturns return values.typeSetScopeTextReturnsstruct { Scope *Scope`json:"scope,omitempty"`// The resulting CSS Scope rule after modification.}// Do executes CSS.setScopeText against the provided context.//// returns://// scope - The resulting CSS Scope rule after modification.func ( *SetScopeTextParams) ( context.Context) ( *Scope, error) {// executevarSetScopeTextReturns = cdp.Execute(, CommandSetScopeText, , &)if != nil {returnnil, }return .Scope, nil}// SetRuleSelectorParams modifies the rule selector.typeSetRuleSelectorParamsstruct { StyleSheetID StyleSheetID`json:"styleSheetId"` Range *SourceRange`json:"range"` Selector string`json:"selector"`}// SetRuleSelector modifies the rule selector.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setRuleSelector//// parameters://// styleSheetID// range// selectorfunc ( StyleSheetID, *SourceRange, string) *SetRuleSelectorParams {return &SetRuleSelectorParams{StyleSheetID: ,Range: ,Selector: , }}// SetRuleSelectorReturns return values.typeSetRuleSelectorReturnsstruct { SelectorList *SelectorList`json:"selectorList,omitempty"`// The resulting selector list after modification.}// Do executes CSS.setRuleSelector against the provided context.//// returns://// selectorList - The resulting selector list after modification.func ( *SetRuleSelectorParams) ( context.Context) ( *SelectorList, error) {// executevarSetRuleSelectorReturns = cdp.Execute(, CommandSetRuleSelector, , &)if != nil {returnnil, }return .SelectorList, nil}// SetStyleSheetTextParams sets the new stylesheet text.typeSetStyleSheetTextParamsstruct { StyleSheetID StyleSheetID`json:"styleSheetId"` Text string`json:"text"`}// SetStyleSheetText sets the new stylesheet text.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setStyleSheetText//// parameters://// styleSheetID// textfunc ( StyleSheetID, string) *SetStyleSheetTextParams {return &SetStyleSheetTextParams{StyleSheetID: ,Text: , }}// SetStyleSheetTextReturns return values.typeSetStyleSheetTextReturnsstruct { SourceMapURL string`json:"sourceMapURL,omitempty"`// URL of source map associated with script (if any).}// Do executes CSS.setStyleSheetText against the provided context.//// returns://// sourceMapURL - URL of source map associated with script (if any).func ( *SetStyleSheetTextParams) ( context.Context) ( string, error) {// executevarSetStyleSheetTextReturns = cdp.Execute(, CommandSetStyleSheetText, , &)if != nil {return"", }return .SourceMapURL, nil}// SetStyleTextsParams applies specified style edits one after another in the// given order.typeSetStyleTextsParamsstruct { Edits []*StyleDeclarationEdit`json:"edits"`}// SetStyleTexts applies specified style edits one after another in the given// order.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setStyleTexts//// parameters://// editsfunc ( []*StyleDeclarationEdit) *SetStyleTextsParams {return &SetStyleTextsParams{Edits: , }}// SetStyleTextsReturns return values.typeSetStyleTextsReturnsstruct { Styles []*Style`json:"styles,omitempty"`// The resulting styles after modification.}// Do executes CSS.setStyleTexts against the provided context.//// returns://// styles - The resulting styles after modification.func ( *SetStyleTextsParams) ( context.Context) ( []*Style, error) {// executevarSetStyleTextsReturns = cdp.Execute(, CommandSetStyleTexts, , &)if != nil {returnnil, }return .Styles, nil}// StartRuleUsageTrackingParams enables the selector recording.typeStartRuleUsageTrackingParamsstruct{}// StartRuleUsageTracking enables the selector recording.//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-startRuleUsageTrackingfunc () *StartRuleUsageTrackingParams {return &StartRuleUsageTrackingParams{}}// Do executes CSS.startRuleUsageTracking against the provided context.func ( *StartRuleUsageTrackingParams) ( context.Context) ( error) {returncdp.Execute(, CommandStartRuleUsageTracking, nil, nil)}// StopRuleUsageTrackingParams stop tracking rule usage and return the list// of rules that were used since last call to takeCoverageDelta (or since start// of coverage instrumentation).typeStopRuleUsageTrackingParamsstruct{}// StopRuleUsageTracking stop tracking rule usage and return the list of// rules that were used since last call to takeCoverageDelta (or since start of// coverage instrumentation).//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-stopRuleUsageTrackingfunc () *StopRuleUsageTrackingParams {return &StopRuleUsageTrackingParams{}}// StopRuleUsageTrackingReturns return values.typeStopRuleUsageTrackingReturnsstruct { RuleUsage []*RuleUsage`json:"ruleUsage,omitempty"`}// Do executes CSS.stopRuleUsageTracking against the provided context.//// returns://// ruleUsagefunc ( *StopRuleUsageTrackingParams) ( context.Context) ( []*RuleUsage, error) {// executevarStopRuleUsageTrackingReturns = cdp.Execute(, CommandStopRuleUsageTracking, nil, &)if != nil {returnnil, }return .RuleUsage, nil}// TakeCoverageDeltaParams obtain list of rules that became used since last// call to this method (or since start of coverage instrumentation).typeTakeCoverageDeltaParamsstruct{}// TakeCoverageDelta obtain list of rules that became used since last call to// this method (or since start of coverage instrumentation).//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-takeCoverageDeltafunc () *TakeCoverageDeltaParams {return &TakeCoverageDeltaParams{}}// TakeCoverageDeltaReturns return values.typeTakeCoverageDeltaReturnsstruct { Coverage []*RuleUsage`json:"coverage,omitempty"` Timestamp float64`json:"timestamp,omitempty"`// Monotonically increasing time, in seconds.}// Do executes CSS.takeCoverageDelta against the provided context.//// returns://// coverage// timestamp - Monotonically increasing time, in seconds.func ( *TakeCoverageDeltaParams) ( context.Context) ( []*RuleUsage, float64, error) {// executevarTakeCoverageDeltaReturns = cdp.Execute(, CommandTakeCoverageDelta, nil, &)if != nil {returnnil, 0, }return .Coverage, .Timestamp, nil}// SetLocalFontsEnabledParams enables/disables rendering of local CSS fonts// (enabled by default).typeSetLocalFontsEnabledParamsstruct { Enabled bool`json:"enabled"`// Whether rendering of local fonts is enabled.}// SetLocalFontsEnabled enables/disables rendering of local CSS fonts// (enabled by default).//// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setLocalFontsEnabled//// parameters://// enabled - Whether rendering of local fonts is enabled.func ( bool) *SetLocalFontsEnabledParams {return &SetLocalFontsEnabledParams{Enabled: , }}// Do executes CSS.setLocalFontsEnabled against the provided context.func ( *SetLocalFontsEnabledParams) ( context.Context) ( error) {returncdp.Execute(, CommandSetLocalFontsEnabled, , nil)}// Command names.const (CommandAddRule = "CSS.addRule"CommandCollectClassNames = "CSS.collectClassNames"CommandCreateStyleSheet = "CSS.createStyleSheet"CommandDisable = "CSS.disable"CommandEnable = "CSS.enable"CommandForcePseudoState = "CSS.forcePseudoState"CommandGetBackgroundColors = "CSS.getBackgroundColors"CommandGetComputedStyleForNode = "CSS.getComputedStyleForNode"CommandGetInlineStylesForNode = "CSS.getInlineStylesForNode"CommandGetMatchedStylesForNode = "CSS.getMatchedStylesForNode"CommandGetMediaQueries = "CSS.getMediaQueries"CommandGetPlatformFontsForNode = "CSS.getPlatformFontsForNode"CommandGetStyleSheetText = "CSS.getStyleSheetText"CommandGetLayersForNode = "CSS.getLayersForNode"CommandTrackComputedStyleUpdates = "CSS.trackComputedStyleUpdates"CommandTakeComputedStyleUpdates = "CSS.takeComputedStyleUpdates"CommandSetEffectivePropertyValueForNode = "CSS.setEffectivePropertyValueForNode"CommandSetPropertyRulePropertyName = "CSS.setPropertyRulePropertyName"CommandSetKeyframeKey = "CSS.setKeyframeKey"CommandSetMediaText = "CSS.setMediaText"CommandSetContainerQueryText = "CSS.setContainerQueryText"CommandSetSupportsText = "CSS.setSupportsText"CommandSetScopeText = "CSS.setScopeText"CommandSetRuleSelector = "CSS.setRuleSelector"CommandSetStyleSheetText = "CSS.setStyleSheetText"CommandSetStyleTexts = "CSS.setStyleTexts"CommandStartRuleUsageTracking = "CSS.startRuleUsageTracking"CommandStopRuleUsageTracking = "CSS.stopRuleUsageTracking"CommandTakeCoverageDelta = "CSS.takeCoverageDelta"CommandSetLocalFontsEnabled = "CSS.setLocalFontsEnabled")
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.