Accessibility

class Accessibility(cdp: CDP) : Domain

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class AXNode(val nodeId: String, val ignored: Boolean, val ignoredReasons: List<Accessibility.AXProperty>? = null, val role: Accessibility.AXValue? = null, val chromeRole: Accessibility.AXValue? = null, val name: Accessibility.AXValue? = null, val description: Accessibility.AXValue? = null, val value: Accessibility.AXValue? = null, val properties: List<Accessibility.AXProperty>? = null, val parentId: String? = null, val childIds: List<String>? = null, val backendDOMNodeId: Int? = null, val frameId: String? = null)

A node in the accessibility tree.

Link copied to clipboard
@Serializable
data class AXProperty(val name: Accessibility.AXPropertyName, val value: Accessibility.AXValue)
Link copied to clipboard

Values of AXProperty name:

Link copied to clipboard
@Serializable
data class AXRelatedNode(val backendDOMNodeId: Int, val idref: String? = null, val text: String? = null)
Link copied to clipboard
@Serializable
data class AXValue(val type: Accessibility.AXValueType, val value: JsonElement? = null, val relatedNodes: List<Accessibility.AXRelatedNode>? = null, val sources: List<Accessibility.AXValueSource>? = null)

A single computed AX property.

Link copied to clipboard

Enum of possible native property sources (as a subtype of a particular AXValueSourceType).

Link copied to clipboard
@Serializable
data class AXValueSource(val type: Accessibility.AXValueSourceType, val value: Accessibility.AXValue? = null, val attribute: String? = null, val attributeValue: Accessibility.AXValue? = null, val superseded: Boolean? = null, val nativeSource: Accessibility.AXValueNativeSourceType? = null, val nativeSourceValue: Accessibility.AXValue? = null, val invalid: Boolean? = null, val invalidReason: String? = null)

A single source for a computed AX property.

Link copied to clipboard

Enum of possible property sources.

Link copied to clipboard

Enum of possible property types.

Link copied to clipboard
@Serializable
data class GetAXNodeAndAncestorsParameter(val nodeId: Int? = null, val backendNodeId: Int? = null, val objectId: String? = null)
Link copied to clipboard
@Serializable
data class GetAXNodeAndAncestorsReturn(val nodes: List<Accessibility.AXNode>)
Link copied to clipboard
@Serializable
data class GetChildAXNodesParameter(val id: String, val frameId: String? = null)
Link copied to clipboard
@Serializable
data class GetChildAXNodesReturn(val nodes: List<Accessibility.AXNode>)
Link copied to clipboard
@Serializable
data class GetFullAXTreeParameter(val depth: Int? = null, val frameId: String? = null)
Link copied to clipboard
@Serializable
data class GetFullAXTreeReturn(val nodes: List<Accessibility.AXNode>)
Link copied to clipboard
@Serializable
data class GetPartialAXTreeParameter(val nodeId: Int? = null, val backendNodeId: Int? = null, val objectId: String? = null, val fetchRelatives: Boolean? = null)
Link copied to clipboard
@Serializable
data class GetPartialAXTreeReturn(val nodes: List<Accessibility.AXNode>)
Link copied to clipboard
@Serializable
data class GetRootAXNodeParameter(val frameId: String? = null)
Link copied to clipboard
@Serializable
data class GetRootAXNodeReturn(val node: Accessibility.AXNode)
Link copied to clipboard
@Serializable
data class LoadCompleteParameter(val root: Accessibility.AXNode)

The loadComplete event mirrors the load complete event sent by the browser to assistive technology when the web page has finished loading.

Link copied to clipboard
@Serializable
data class NodesUpdatedParameter(val nodes: List<Accessibility.AXNode>)

The nodesUpdated event is sent every time a previously requested node has changed the in tree.

Link copied to clipboard
@Serializable
data class QueryAXTreeParameter(val nodeId: Int? = null, val backendNodeId: Int? = null, val objectId: String? = null, val accessibleName: String? = null, val role: String? = null)
Link copied to clipboard
@Serializable
data class QueryAXTreeReturn(val nodes: List<Accessibility.AXNode>)

Properties

Link copied to clipboard

The loadComplete event mirrors the load complete event sent by the browser to assistive technology when the web page has finished loading.

Link copied to clipboard

The nodesUpdated event is sent every time a previously requested node has changed the in tree.

Functions

Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)

Disables the accessibility domain.

Link copied to clipboard
suspend fun enable(mode: CommandMode = CommandMode.DEFAULT)

Enables the accessibility domain which causes AXNodeIds to remain consistent between method calls. This turns on accessibility for the page, which can impact performance until accessibility is disabled.

Link copied to clipboard
suspend fun getAXNodeAndAncestors(nodeId: Int? = null, backendNodeId: Int? = null, objectId: String? = null): Accessibility.GetAXNodeAndAncestorsReturn

Fetches a node and all ancestors up to and including the root. Requires enable() to have been called previously.

Link copied to clipboard

Fetches a particular accessibility node by AXNodeId. Requires enable() to have been called previously.

Link copied to clipboard
suspend fun getFullAXTree(depth: Int? = null, frameId: String? = null): Accessibility.GetFullAXTreeReturn

Fetches the entire accessibility tree for the root Document

Link copied to clipboard
suspend fun getPartialAXTree(nodeId: Int? = null, backendNodeId: Int? = null, objectId: String? = null, fetchRelatives: Boolean? = null): Accessibility.GetPartialAXTreeReturn

Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.

Link copied to clipboard

Fetches the root node. Requires enable() to have been called previously.

Link copied to clipboard
suspend fun queryAXTree(nodeId: Int? = null, backendNodeId: Int? = null, objectId: String? = null, accessibleName: String? = null, role: String? = null): Accessibility.QueryAXTreeReturn

Query a DOM node's accessibility subtree for accessible name and role. This command computes the name and role for all nodes in the subtree, including those that are ignored for accessibility, and returns those that match the specified name and role. If no DOM node is specified, or the DOM node does not exist, the command returns an error. If neither accessibleName or role is specified, it returns all the accessibility nodes in the subtree.