Interface ICSS
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 getStyleSheetText methods.
[Experimental("BIDICDP001")]
public interface ICSS
Properties
ComputedStyleUpdated
IEventSource<ComputedStyleUpdatedEventArgs> ComputedStyleUpdated { get; }
Property Value
- IEventSource<ComputedStyleUpdatedEventArgs>
Remarks
Event args (ComputedStyleUpdatedEventArgs):
- NodeId - The node id that has updated computed styles.
FontsUpdated
Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded web font.
IEventSource<FontsUpdatedEventArgs> FontsUpdated { get; }
Property Value
- IEventSource<FontsUpdatedEventArgs>
Remarks
Event args (FontsUpdatedEventArgs):
- Font - The web font that has loaded.
MediaQueryResultChanged
Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features.
IEventSource<MediaQueryResultChangedEventArgs> MediaQueryResultChanged { get; }
Property Value
- IEventSource<MediaQueryResultChangedEventArgs>
StyleSheetAdded
Fired whenever an active document stylesheet is added.
IEventSource<StyleSheetAddedEventArgs> StyleSheetAdded { get; }
Property Value
- IEventSource<StyleSheetAddedEventArgs>
Remarks
Event args (StyleSheetAddedEventArgs):
- Header - Added stylesheet metainfo.
StyleSheetChanged
Fired whenever a stylesheet is changed as a result of the client operation.
IEventSource<StyleSheetChangedEventArgs> StyleSheetChanged { get; }
Property Value
- IEventSource<StyleSheetChangedEventArgs>
Remarks
Event args (StyleSheetChangedEventArgs):
- StyleSheetId
StyleSheetRemoved
Fired whenever an active document stylesheet is removed.
IEventSource<StyleSheetRemovedEventArgs> StyleSheetRemoved { get; }
Property Value
- IEventSource<StyleSheetRemovedEventArgs>
Remarks
Event args (StyleSheetRemovedEventArgs):
- StyleSheetId - Identifier of the removed stylesheet.
Methods
AddRuleAsync(StyleSheetId, string, SourceRange, NodeId?, string?, CancellationToken)
Inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the position specified by location.
Task<AddRuleResult> AddRuleAsync(StyleSheetId styleSheetId, string ruleText, SourceRange location, NodeId? nodeForPropertySyntaxValidation = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdThe css style sheet identifier where a new rule should be inserted.
ruleTextstringThe text of a new rule.
locationSourceRangeText position of a new rule in the target style sheet.
nodeForPropertySyntaxValidationNodeIdNodeId for the DOM node in whose context custom property declarations for registered properties should be validated. If omitted, declarations in the new rule text can only be validated statically, which may produce incorrect results if the declaration contains a var() for example.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<AddRuleResult>
A task representing the asynchronous operation, containing a AddRuleResult.
CollectClassNamesAsync(StyleSheetId, string?, CancellationToken)
Returns all class names from specified stylesheet.
Task<CollectClassNamesResult> CollectClassNamesAsync(StyleSheetId styleSheetId, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<CollectClassNamesResult>
A task representing the asynchronous operation, containing a CollectClassNamesResult.
CreateStyleSheetAsync(FrameId, bool?, string?, CancellationToken)
Creates a new special "via-inspector" stylesheet in the frame with given frameId.
Task<CreateStyleSheetResult> CreateStyleSheetAsync(FrameId frameId, bool? force = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
frameIdFrameIdIdentifier of the frame where "via-inspector" stylesheet should be created.
forcebool?If true, creates a new stylesheet for every call. If false, returns a stylesheet previously created by a call with force=false for the frame's document if it exists or creates a new stylesheet (default: false).
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<CreateStyleSheetResult>
A task representing the asynchronous operation, containing a CreateStyleSheetResult.
DisableAsync(string?, CancellationToken)
Disables the CSS agent for the given page.
Task<DisableResult> DisableAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<DisableResult>
A task representing the asynchronous operation, containing a DisableResult.
EnableAsync(string?, CancellationToken)
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.
Task<EnableResult> EnableAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<EnableResult>
A task representing the asynchronous operation, containing a EnableResult.
ForcePseudoStateAsync(NodeId, ImmutableArray<string>, string?, CancellationToken)
Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.
Task<ForcePseudoStateResult> ForcePseudoStateAsync(NodeId nodeId, ImmutableArray<string> forcedPseudoClasses, string? session = null, CancellationToken cancellationToken = default)
Parameters
nodeIdNodeIdThe element id for which to force the pseudo state.
forcedPseudoClassesImmutableArray<string>Element pseudo classes to force when computing the element's style.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<ForcePseudoStateResult>
A task representing the asynchronous operation, containing a ForcePseudoStateResult.
ForceStartingStyleAsync(NodeId, bool, string?, CancellationToken)
Ensures that the given node is in its starting-style state.
Task<ForceStartingStyleResult> ForceStartingStyleAsync(NodeId nodeId, bool forced, string? session = null, CancellationToken cancellationToken = default)
Parameters
nodeIdNodeIdThe element id for which to force the starting-style state.
forcedboolBoolean indicating if this is on or off.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<ForceStartingStyleResult>
A task representing the asynchronous operation, containing a ForceStartingStyleResult.
GetAnimatedStylesForNodeAsync(NodeId, string?, CancellationToken)
Returns the styles coming from animations & transitions including the animation & transition styles coming from inheritance chain.
Task<GetAnimatedStylesForNodeResult> GetAnimatedStylesForNodeAsync(NodeId nodeId, string? session = null, CancellationToken cancellationToken = default)
Parameters
nodeIdNodeIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetAnimatedStylesForNodeResult>
A task representing the asynchronous operation, containing a GetAnimatedStylesForNodeResult.
GetBackgroundColorsAsync(NodeId, string?, CancellationToken)
Task<GetBackgroundColorsResult> GetBackgroundColorsAsync(NodeId nodeId, string? session = null, CancellationToken cancellationToken = default)
Parameters
nodeIdNodeIdId of the node to get background colors for.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetBackgroundColorsResult>
A task representing the asynchronous operation, containing a GetBackgroundColorsResult.
GetComputedStyleForNodeAsync(NodeId, string?, CancellationToken)
Returns the computed style for a DOM node identified by nodeId.
Task<GetComputedStyleForNodeResult> GetComputedStyleForNodeAsync(NodeId nodeId, string? session = null, CancellationToken cancellationToken = default)
Parameters
nodeIdNodeIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetComputedStyleForNodeResult>
A task representing the asynchronous operation, containing a GetComputedStyleForNodeResult.
GetEnvironmentVariablesAsync(string?, CancellationToken)
Returns the values of the default UA-defined environment variables used in env()
Task<GetEnvironmentVariablesResult> GetEnvironmentVariablesAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetEnvironmentVariablesResult>
A task representing the asynchronous operation, containing a GetEnvironmentVariablesResult.
GetInlineStylesForNodeAsync(NodeId, string?, CancellationToken)
Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM attributes) for a DOM node identified by nodeId.
Task<GetInlineStylesForNodeResult> GetInlineStylesForNodeAsync(NodeId nodeId, string? session = null, CancellationToken cancellationToken = default)
Parameters
nodeIdNodeIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetInlineStylesForNodeResult>
A task representing the asynchronous operation, containing a GetInlineStylesForNodeResult.
GetLayersForNodeAsync(NodeId, string?, CancellationToken)
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.
Task<GetLayersForNodeResult> GetLayersForNodeAsync(NodeId nodeId, string? session = null, CancellationToken cancellationToken = default)
Parameters
nodeIdNodeIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetLayersForNodeResult>
A task representing the asynchronous operation, containing a GetLayersForNodeResult.
GetLocationForSelectorAsync(StyleSheetId, string, string?, CancellationToken)
Given a CSS selector text and a style sheet ID, getLocationForSelector returns an array of locations of the CSS selector in the style sheet.
Task<GetLocationForSelectorResult> GetLocationForSelectorAsync(StyleSheetId styleSheetId, string selectorText, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdselectorTextstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetLocationForSelectorResult>
A task representing the asynchronous operation, containing a GetLocationForSelectorResult.
GetLonghandPropertiesAsync(string, string, string?, CancellationToken)
Task<GetLonghandPropertiesResult> GetLonghandPropertiesAsync(string shorthandName, string value, string? session = null, CancellationToken cancellationToken = default)
Parameters
shorthandNamestringvaluestringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetLonghandPropertiesResult>
A task representing the asynchronous operation, containing a GetLonghandPropertiesResult.
GetMatchedStylesForNodeAsync(NodeId, string?, CancellationToken)
Returns requested styles for a DOM node identified by nodeId.
Task<GetMatchedStylesForNodeResult> GetMatchedStylesForNodeAsync(NodeId nodeId, string? session = null, CancellationToken cancellationToken = default)
Parameters
nodeIdNodeIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetMatchedStylesForNodeResult>
A task representing the asynchronous operation, containing a GetMatchedStylesForNodeResult.
GetMediaQueriesAsync(string?, CancellationToken)
Returns all media queries parsed by the rendering engine.
Task<GetMediaQueriesResult> GetMediaQueriesAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetMediaQueriesResult>
A task representing the asynchronous operation, containing a GetMediaQueriesResult.
GetPlatformFontsForNodeAsync(NodeId, string?, CancellationToken)
Requests information about platform fonts which we used to render child TextNodes in the given node.
Task<GetPlatformFontsForNodeResult> GetPlatformFontsForNodeAsync(NodeId nodeId, string? session = null, CancellationToken cancellationToken = default)
Parameters
nodeIdNodeIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetPlatformFontsForNodeResult>
A task representing the asynchronous operation, containing a GetPlatformFontsForNodeResult.
GetStyleSheetTextAsync(StyleSheetId, string?, CancellationToken)
Returns the current textual content for a stylesheet.
Task<GetStyleSheetTextResult> GetStyleSheetTextAsync(StyleSheetId styleSheetId, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<GetStyleSheetTextResult>
A task representing the asynchronous operation, containing a GetStyleSheetTextResult.
ResolveValuesAsync(ImmutableArray<string>, NodeId, string?, PseudoType?, string?, string?, CancellationToken)
Resolve the specified values in the context of the provided element. For example, a value of '1em' is evaluated according to the computed 'font-size' of the element and a value 'calc(1px + 2px)' will be resolved to '3px'. If the propertyName was specified the values are resolved as if they were property's declaration. If a value cannot be parsed according to the provided property syntax, the value is parsed using combined syntax as if null propertyName was provided. If the value cannot be resolved even then, return the provided value without any changes. Note: this function currently does not resolve CSS random() function, it returns unmodified random() function parts.`
Task<ResolveValuesResult> ResolveValuesAsync(ImmutableArray<string> values, NodeId nodeId, string? propertyName = null, PseudoType? pseudoType = null, string? pseudoIdentifier = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
valuesImmutableArray<string>Cascade-dependent keywords (revert/revert-layer) do not work.
nodeIdNodeIdId of the node in whose context the expression is evaluated
propertyNamestringOnly longhands and custom property names are accepted.
pseudoTypePseudoType?Pseudo element type, only works for pseudo elements that generate elements in the tree, such as ::before and ::after.
pseudoIdentifierstringPseudo element custom ident.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<ResolveValuesResult>
A task representing the asynchronous operation, containing a ResolveValuesResult.
SetContainerQueryConditionTextAsync(StyleSheetId, SourceRange, string, string?, CancellationToken)
Task<SetContainerQueryConditionTextResult> SetContainerQueryConditionTextAsync(StyleSheetId styleSheetId, SourceRange range, string text, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdrangeSourceRangetextstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetContainerQueryConditionTextResult>
A task representing the asynchronous operation, containing a SetContainerQueryConditionTextResult.
SetContainerQueryTextAsync(StyleSheetId, SourceRange, string, string?, CancellationToken)
Modifies the expression of a container query. Deprecated. Use setContainerQueryConditionText instead.
[Obsolete]
Task<SetContainerQueryTextResult> SetContainerQueryTextAsync(StyleSheetId styleSheetId, SourceRange range, string text, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdrangeSourceRangetextstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetContainerQueryTextResult>
A task representing the asynchronous operation, containing a SetContainerQueryTextResult.
SetEffectivePropertyValueForNodeAsync(NodeId, string, string, string?, CancellationToken)
Find a rule with the given active property for the given node and set the new value for this property
Task<SetEffectivePropertyValueForNodeResult> SetEffectivePropertyValueForNodeAsync(NodeId nodeId, string propertyName, string value, string? session = null, CancellationToken cancellationToken = default)
Parameters
nodeIdNodeIdThe element id for which to set property.
propertyNamestringvaluestringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetEffectivePropertyValueForNodeResult>
A task representing the asynchronous operation, containing a SetEffectivePropertyValueForNodeResult.
SetKeyframeKeyAsync(StyleSheetId, SourceRange, string, string?, CancellationToken)
Modifies the keyframe rule key text.
Task<SetKeyframeKeyResult> SetKeyframeKeyAsync(StyleSheetId styleSheetId, SourceRange range, string keyText, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdrangeSourceRangekeyTextstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetKeyframeKeyResult>
A task representing the asynchronous operation, containing a SetKeyframeKeyResult.
SetLocalFontsEnabledAsync(bool, string?, CancellationToken)
Enables/disables rendering of local CSS fonts (enabled by default).
Task<SetLocalFontsEnabledResult> SetLocalFontsEnabledAsync(bool enabled, string? session = null, CancellationToken cancellationToken = default)
Parameters
enabledboolWhether rendering of local fonts is enabled.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetLocalFontsEnabledResult>
A task representing the asynchronous operation, containing a SetLocalFontsEnabledResult.
SetMediaTextAsync(StyleSheetId, SourceRange, string, string?, CancellationToken)
Modifies the rule selector.
Task<SetMediaTextResult> SetMediaTextAsync(StyleSheetId styleSheetId, SourceRange range, string text, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdrangeSourceRangetextstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetMediaTextResult>
A task representing the asynchronous operation, containing a SetMediaTextResult.
SetNavigationTextAsync(StyleSheetId, SourceRange, string, string?, CancellationToken)
Modifies the expression of a navigation at-rule.
Task<SetNavigationTextResult> SetNavigationTextAsync(StyleSheetId styleSheetId, SourceRange range, string text, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdrangeSourceRangetextstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetNavigationTextResult>
A task representing the asynchronous operation, containing a SetNavigationTextResult.
SetPropertyRulePropertyNameAsync(StyleSheetId, SourceRange, string, string?, CancellationToken)
Modifies the property rule property name.
Task<SetPropertyRulePropertyNameResult> SetPropertyRulePropertyNameAsync(StyleSheetId styleSheetId, SourceRange range, string propertyName, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdrangeSourceRangepropertyNamestringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetPropertyRulePropertyNameResult>
A task representing the asynchronous operation, containing a SetPropertyRulePropertyNameResult.
SetRuleSelectorAsync(StyleSheetId, SourceRange, string, string?, CancellationToken)
Modifies the rule selector.
Task<SetRuleSelectorResult> SetRuleSelectorAsync(StyleSheetId styleSheetId, SourceRange range, string selector, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdrangeSourceRangeselectorstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetRuleSelectorResult>
A task representing the asynchronous operation, containing a SetRuleSelectorResult.
SetScopeTextAsync(StyleSheetId, SourceRange, string, string?, CancellationToken)
Modifies the expression of a scope at-rule.
Task<SetScopeTextResult> SetScopeTextAsync(StyleSheetId styleSheetId, SourceRange range, string text, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdrangeSourceRangetextstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetScopeTextResult>
A task representing the asynchronous operation, containing a SetScopeTextResult.
SetStyleSheetTextAsync(StyleSheetId, string, string?, CancellationToken)
Sets the new stylesheet text.
Task<SetStyleSheetTextResult> SetStyleSheetTextAsync(StyleSheetId styleSheetId, string text, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdtextstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetStyleSheetTextResult>
A task representing the asynchronous operation, containing a SetStyleSheetTextResult.
SetStyleTextsAsync(ImmutableArray<StyleDeclarationEdit>, NodeId?, string?, CancellationToken)
Applies specified style edits one after another in the given order.
Task<SetStyleTextsResult> SetStyleTextsAsync(ImmutableArray<StyleDeclarationEdit> edits, NodeId? nodeForPropertySyntaxValidation = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
editsImmutableArray<StyleDeclarationEdit>nodeForPropertySyntaxValidationNodeIdNodeId for the DOM node in whose context custom property declarations for registered properties should be validated. If omitted, declarations in the new rule text can only be validated statically, which may produce incorrect results if the declaration contains a var() for example.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetStyleTextsResult>
A task representing the asynchronous operation, containing a SetStyleTextsResult.
SetSupportsTextAsync(StyleSheetId, SourceRange, string, string?, CancellationToken)
Modifies the expression of a supports at-rule.
Task<SetSupportsTextResult> SetSupportsTextAsync(StyleSheetId styleSheetId, SourceRange range, string text, string? session = null, CancellationToken cancellationToken = default)
Parameters
styleSheetIdStyleSheetIdrangeSourceRangetextstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetSupportsTextResult>
A task representing the asynchronous operation, containing a SetSupportsTextResult.
StartRuleUsageTrackingAsync(string?, CancellationToken)
Enables the selector recording.
Task<StartRuleUsageTrackingResult> StartRuleUsageTrackingAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<StartRuleUsageTrackingResult>
A task representing the asynchronous operation, containing a StartRuleUsageTrackingResult.
StopRuleUsageTrackingAsync(string?, CancellationToken)
Stop tracking rule usage and return the list of rules that were used since last call to takeCoverageDelta (or since start of coverage instrumentation).
Task<StopRuleUsageTrackingResult> StopRuleUsageTrackingAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<StopRuleUsageTrackingResult>
A task representing the asynchronous operation, containing a StopRuleUsageTrackingResult.
TakeComputedStyleUpdatesAsync(string?, CancellationToken)
Polls the next batch of computed style updates.
Task<TakeComputedStyleUpdatesResult> TakeComputedStyleUpdatesAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<TakeComputedStyleUpdatesResult>
A task representing the asynchronous operation, containing a TakeComputedStyleUpdatesResult.
TakeCoverageDeltaAsync(string?, CancellationToken)
Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation).
Task<TakeCoverageDeltaResult> TakeCoverageDeltaAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<TakeCoverageDeltaResult>
A task representing the asynchronous operation, containing a TakeCoverageDeltaResult.
TrackComputedStyleUpdatesAsync(ImmutableArray<CSSComputedStyleProperty>, string?, CancellationToken)
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.
Task<TrackComputedStyleUpdatesResult> TrackComputedStyleUpdatesAsync(ImmutableArray<CSSComputedStyleProperty> propertiesToTrack, string? session = null, CancellationToken cancellationToken = default)
Parameters
propertiesToTrackImmutableArray<CSSComputedStyleProperty>sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<TrackComputedStyleUpdatesResult>
A task representing the asynchronous operation, containing a TrackComputedStyleUpdatesResult.
TrackComputedStyleUpdatesForNodeAsync(NodeId?, string?, CancellationToken)
Starts tracking the given node for the computed style updates and whenever the computed style is updated for node, it queues a computedStyleUpdated event with throttling. There can only be 1 node tracked for computed style updates so passing a new node id removes tracking from the previous node. Pass undefined to disable tracking.
Task<TrackComputedStyleUpdatesForNodeResult> TrackComputedStyleUpdatesForNodeAsync(NodeId? nodeId = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
nodeIdNodeIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<TrackComputedStyleUpdatesForNodeResult>
A task representing the asynchronous operation, containing a TrackComputedStyleUpdatesForNodeResult.