puppeteer/new-docs/puppeteer.protocol.css.md
2020-07-13 14:01:35 +01:00

7.1 KiB

Home > puppeteer > Protocol > CSS

Protocol.CSS namespace

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.

Signature:

export namespace CSS 

Interfaces

Interface Description
AddRuleRequest
AddRuleResponse
CollectClassNamesRequest
CollectClassNamesResponse
CreateStyleSheetRequest
CreateStyleSheetResponse
CSSComputedStyleProperty
CSSKeyframeRule CSS keyframe rule representation.
CSSKeyframesRule CSS keyframes rule representation.
CSSMedia CSS media rule descriptor.
CSSProperty CSS property declaration data.
CSSRule CSS rule representation.
CSSStyle CSS style representation.
CSSStyleSheetHeader CSS stylesheet metainformation.
FontFace Properties of a web font: https://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#font-descriptions
FontsUpdatedEvent Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded web font
ForcePseudoStateRequest
GetBackgroundColorsRequest
GetBackgroundColorsResponse
GetComputedStyleForNodeRequest
GetComputedStyleForNodeResponse
GetInlineStylesForNodeRequest
GetInlineStylesForNodeResponse
GetMatchedStylesForNodeRequest
GetMatchedStylesForNodeResponse
GetMediaQueriesResponse
GetPlatformFontsForNodeRequest
GetPlatformFontsForNodeResponse
GetStyleSheetTextRequest
GetStyleSheetTextResponse
InheritedStyleEntry Inherited CSS rule collection from ancestor node.
MediaQuery Media query descriptor.
MediaQueryExpression Media query expression descriptor.
PlatformFontUsage Information about amount of glyphs that were rendered with given font.
PseudoElementMatches CSS rule collection for a single pseudo style.
RuleMatch Match data for a CSS rule.
RuleUsage CSS coverage information.
SelectorList Selector list data.
SetEffectivePropertyValueForNodeRequest
SetKeyframeKeyRequest
SetKeyframeKeyResponse
SetMediaTextRequest
SetMediaTextResponse
SetRuleSelectorRequest
SetRuleSelectorResponse
SetStyleSheetTextRequest
SetStyleSheetTextResponse
SetStyleTextsRequest
SetStyleTextsResponse
ShorthandEntry
SourceRange Text range within a resource. All numbers are zero-based.
StopRuleUsageTrackingResponse
StyleDeclarationEdit A descriptor of operation to mutate style declaration text.
StyleSheetAddedEvent Fired whenever an active document stylesheet is added.
StyleSheetChangedEvent Fired whenever a stylesheet is changed as a result of the client operation.
StyleSheetRemovedEvent Fired whenever an active document stylesheet is removed.
TakeCoverageDeltaResponse
Value Data for a simple selector (these are delimited by commas in a selector list).

Type Aliases

Type Alias Description
StyleSheetId
StyleSheetOrigin Stylesheet type: "injected" for stylesheets injected via extension, "user-agent" for user-agent stylesheets, "inspector" for stylesheets created by the inspector (i.e. those holding the "via inspector" rules), "regular" for regular stylesheets.