跳到主要内容

Accessibility🧪

✅️️ Methods

🔨Accessibility.disable

禁用无障碍功能域。

EN
Disables the accessibility domain.

🔨Accessibility.enable

启用无障碍功能域,使AXNodeId在方法调用之间保持一致。这会开启页面的无障碍功能,在无障碍功能被禁用之前可能会影响性能。

EN
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.

🔨Accessibility.getAXNodeAndAncestors🧪

获取一个节点及其所有祖先节点,直至包括根节点。需要事先调用 enable() 方法。

EN
Fetches a node and all ancestors up to and including the root. Requires enable() to have been called previously.
参数必填标记类型描述原文
nodeIdDOM.NodeId获取节点的标识符。
ENIdentifier of the node to get.
backendNodeIdDOM.BackendNodeId获取后端节点的标识符。
ENIdentifier of the backend node to get.
objectIdRuntime.RemoteObjectId要获取的节点包装器的JavaScript对象ID。
ENJavaScript object id of the node wrapper to get.
返回对象类型描述原文
nodesarray[AXNode]

🔨Accessibility.getChildAXNodes🧪

通过AXNodeId获取特定的无障碍节点。需要先前已调用enable()

EN
Fetches a particular accessibility node by AXNodeId. Requires enable() to have been called previously.
参数必填标记类型描述原文
id✔️AXNodeId
frameIdPage.FrameId节点所在的文档框架。如果省略,则使用根框架。
ENThe frame in whose document the node resides. If omitted, the root frame is used.
返回对象类型描述原文
nodesarray[AXNode]

🔨Accessibility.getFullAXTree🧪

获取根文档的完整无障碍访问树

EN
Fetches the entire accessibility tree for the root Document
参数必填标记类型描述原文
depthinteger根节点后代的检索最大深度。若省略,则返回完整树结构。
ENThe maximum depth at which descendants of the root node should be retrieved. If omitted, the full tree is returned.
frameIdPage.FrameId应检索其文档的无障碍(AX)树的框架。如果省略,则使用根框架。
ENThe frame for whose document the AX tree should be retrieved. If omitted, the root frame is used.
返回对象类型描述原文
nodesarray[AXNode]

🔨Accessibility.getPartialAXTree🧪

获取此DOM节点(如果存在)的可访问性节点和部分可访问性树。

EN
Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.
参数必填标记类型描述原文
nodeIdDOM.NodeId获取部分可访问性树的节点标识符。
ENIdentifier of the node to get the partial accessibility tree for.
backendNodeIdDOM.BackendNodeId获取部分无障碍树的后端节点标识符。
ENIdentifier of the backend node to get the partial accessibility tree for.
objectIdRuntime.RemoteObjectId节点包装器的JavaScript对象ID,用于获取部分可访问性树。
ENJavaScript object id of the node wrapper to get the partial accessibility tree for.
fetchRelativesboolean是否获取此节点的祖先、兄弟节点和子节点。默认为 true。
ENWhether to fetch this node's ancestors, siblings and children. Defaults to true.
返回对象类型描述原文
nodesarray[AXNode]此DOM节点的Accessibility.AXNode(如果存在),以及根据请求包含其祖先节点、兄弟节点和子节点。
ENThe Accessibility.AXNode for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.

🔨Accessibility.getRootAXNode🧪

获取根节点。需要之前已经调用过 enable() 方法。

EN
Fetches the root node. Requires enable() to have been called previously.
参数必填标记类型描述原文
frameIdPage.FrameId节点所在的文档框架。如果省略,则使用根框架。
ENThe frame in whose document the node resides. If omitted, the root frame is used.
返回对象类型描述原文
nodeAXNode

🔨Accessibility.queryAXTree🧪

查询DOM节点的无障碍子树以获取无障碍名称和角色。该命令会计算子树中所有节点的名称和角色,包括那些在无障碍功能中被忽略的节点,并返回与指定名称和角色匹配的节点。如果未指定DOM节点,或DOM节点不存在,该命令将返回错误。如果未指定accessibleNamerole,则返回子树中的所有无障碍节点。

EN
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.
参数必填标记类型描述原文
nodeIdDOM.NodeId查询根节点的标识符。
ENIdentifier of the node for the root to query.
backendNodeIdDOM.BackendNodeId查询根节点的后端节点标识符。
ENIdentifier of the backend node for the root to query.
objectIdRuntime.RemoteObjectId用于查询的根节点包装器的JavaScript对象ID。
ENJavaScript object id of the node wrapper for the root to query.
accessibleNamestring查找具有此计算名称的节点。
ENFind nodes with this computed name.
rolestring查找具有此计算角色的节点。
ENFind nodes with this computed role.
返回对象类型描述原文
nodesarray[AXNode]一个Accessibility.AXNode列表,匹配指定的属性,包括那些在无障碍功能中被忽略的节点。
ENA list of Accessibility.AXNode matching the specified attributes, including nodes that are ignored for accessibility.

✅️️ Events

👋Accessibility.loadComplete🧪

loadComplete事件反映了当网页完成加载时,浏览器向辅助技术发送的加载完成事件。

EN
The loadComplete event mirrors the load complete event sent by the browser to assistive technology when the web page has finished loading.
参数必填标记类型描述原文
root✔️AXNode新文档根节点。
ENNew document root node.

👋Accessibility.nodesUpdated🧪

每当先前请求的节点在树中发生更改时,就会发送 nodesUpdated 事件。

EN
The nodesUpdated event is sent every time a previously requested node has changed the in tree.
参数必填标记类型描述原文
nodes✔️array[AXNode]已更新节点数据。
ENUpdated node data.

✅️️ Types

📌Accessibility.AXNode

可访问性树中的一个节点。

EN
A node in the accessibility tree.

返回类型:object

属性必填标记类型描述原文
nodeId✔️AXNodeId此节点的唯一标识符。
ENUnique identifier for this node.
ignored✔️boolean此节点是否被忽略以用于无障碍访问
ENWhether this node is ignored for accessibility
ignoredReasonsarray[AXProperty]此节点被隐藏的原因集合。
ENCollection of reasons why this node is hidden.
roleAXValue这个Node的角色,无论是显式还是隐式的。
ENThis Node's role, whether explicit or implicit.
chromeRoleAXValueNode的Chrome原始角色。
ENThis Node's Chrome raw role.
nameAXValueNode的可访问名称。
ENThe accessible name for this Node.
descriptionAXValueNode 的可访问描述。
ENThe accessible description for this Node.
valueAXValue这个Node的值。
ENThe value for this Node.
propertiesarray[AXProperty]所有其他属性
ENAll other properties
parentIdAXNodeId此节点的父节点ID。
ENID for this node's parent.
childIdsarray[AXNodeId]此节点的每个子节点的ID。
ENIDs for each of this node's child nodes.
backendDOMNodeIdDOM.BackendNodeId关联DOM节点的后端ID(如果存在)。
ENThe backend ID for the associated DOM node, if any.
frameIdPage.FrameId与此节点文档关联的框架的框架ID。
ENThe frame ID for the frame associated with this nodes document.

📌Accessibility.AXNodeId

唯一的无障碍节点标识符。

EN
Unique accessibility node identifier.

返回类型:string


📌Accessibility.AXProperty

返回类型:object

属性必填标记类型描述原文
name✔️AXPropertyName此属性的名称。
ENThe name of this property.
value✔️AXValue该属性的值。
ENThe value of this property.

📌Accessibility.AXPropertyName

AXProperty 名称的取值:
- 从 'busy' 到 'roledescription':适用于所有 AX 节点的状态
- 从 'live' 到 'root':适用于实时区域节点的属性
- 从 'autocomplete' 到 'valuetext':适用于控件的属性
- 从 'checked' 到 'selected':适用于控件的状态
- 从 'activedescendant' 到 'owns':除父子/兄弟关系之外的元素间关系
- 从 'activeFullscreenElement' 到 'uninteresting':此节点被隐藏的原因

允许的取值:actions, busy, disabled, editable, focusable, focused, hidden, hiddenRoot, invalid, keyshortcuts, settable, roledescription, live, atomic, relevant, root, autocomplete, hasPopup, level, multiselectable, orientation, multiline, readonly, required, valuemin, valuemax, valuetext, checked, expanded, modal, pressed, selected, activedescendant, controls, describedby, details, errormessage, flowto, labelledby, owns, url, activeFullscreenElement, activeModalDialog, activeAriaModalDialog, ariaHiddenElement, ariaHiddenSubtree, emptyAlt, emptyText, inertElement, inertSubtree, labelContainer, labelFor, notRendered, notVisible, presentationalRole, probablyPresentational, inactiveCarouselTabContent, uninteresting

EN
Values of AXProperty name:
- from 'busy' to 'roledescription': states which apply to every AX node
- from 'live' to 'root': attributes which apply to nodes in live regions
- from 'autocomplete' to 'valuetext': attributes which apply to widgets
- from 'checked' to 'selected': states which apply to widgets
- from 'activedescendant' to 'owns': relationships between elements other than parent/child/sibling
- from 'activeFullscreenElement' to 'uninteresting': reasons why this noode is hidden

Allowed Values: actions, busy, disabled, editable, focusable, focused, hidden, hiddenRoot, invalid, keyshortcuts, settable, roledescription, live, atomic, relevant, root, autocomplete, hasPopup, level, multiselectable, orientation, multiline, readonly, required, valuemin, valuemax, valuetext, checked, expanded, modal, pressed, selected, activedescendant, controls, describedby, details, errormessage, flowto, labelledby, owns, url, activeFullscreenElement, activeModalDialog, activeAriaModalDialog, ariaHiddenElement, ariaHiddenSubtree, emptyAlt, emptyText, inertElement, inertSubtree, labelContainer, labelFor, notRendered, notVisible, presentationalRole, probablyPresentational, inactiveCarouselTabContent, uninteresting

返回类型:string


📌Accessibility.AXRelatedNode

返回类型:object

属性必填标记类型描述原文
backendDOMNodeId✔️DOM.BackendNodeId相关DOM节点的后端节点ID(BackendNodeId)。
ENThe BackendNodeId of the related DOM node.
idrefstring提供的IDRef值(如果有的话)。
ENThe IDRef value provided, if any.
textstring此节点在当前上下文中的文本替代内容。
ENThe text alternative of this node in the current context.

📌Accessibility.AXValue

单个计算出的AX属性。

EN
A single computed AX property.

返回类型:object

属性必填标记类型描述原文
type✔️AXValueType该值的类型。
ENThe type of this value.
valueany此属性的计算值。
ENThe computed value of this property.
relatedNodesarray[AXRelatedNode]一个或多个相关节点(如果适用)。
ENOne or more related nodes, if applicable.
sourcesarray[AXValueSource]构成此属性计算来源的源。
ENThe sources which contributed to the computation of this property.

📌Accessibility.AXValueNativeSourceType

可能的原生属性来源枚举(作为特定AXValueSourceType的子类型)。
允许的值:descriptionfigcaptionlabellabelforlabelwrappedlegendrubyannotationtablecaptiontitleother

EN
Enum of possible native property sources (as a subtype of a particular AXValueSourceType).
Allowed Values: description, figcaption, label, labelfor, labelwrapped, legend, rubyannotation, tablecaption, title, other

返回类型:string


📌Accessibility.AXValueSource

计算出的无障碍属性(AX)的单一来源。

EN
A single source for a computed AX property.

返回类型:object

属性必填标记类型描述原文
type✔️AXValueSourceType这是什么类型的源。
ENWhat type of source this is.
valueAXValue此属性的源值。
ENThe value of this property source.
attributestring相关属性的名称(如果有的话)。
ENThe name of the relevant attribute, if any.
attributeValueAXValue相关属性的值(如果有的话)。
ENThe value of the relevant attribute, if any.
supersededboolean此源是否已被更高优先级的源所取代。
ENWhether this source is superseded by a higher priority source.
nativeSourceAXValueNativeSourceType此值的原生标记源,例如一个<label>元素。
ENThe native markup source for this value, e.g. a <label> element.
nativeSourceValueAXValue原生源的值,例如节点或节点列表。
ENThe value, such as a node or node list, of the native source.
invalidboolean此属性的值是否无效。
ENWhether the value for this property is invalid.
invalidReasonstring如果该值无效,则说明其无效的原因。
ENReason for the value being invalid, if it is.

📌Accessibility.AXValueSourceType

可能的属性来源枚举。
允许的值:attributeimplicitstylecontentsplaceholderrelatedElement

EN
Enum of possible property sources.
Allowed Values: attribute, implicit, style, contents, placeholder, relatedElement

返回类型:string


📌Accessibility.AXValueType

可能的属性类型枚举。
允许的值:booleantristatebooleanOrUndefinedidrefidrefListintegernodenodeListnumberstringcomputedStringtokentokenListdomRelationroleinternalRolevalueUndefined

EN
Enum of possible property types.
Allowed Values: boolean, tristate, booleanOrUndefined, idref, idrefList, integer, node, nodeList, number, string, computedString, token, tokenList, domRelation, role, internalRole, valueUndefined

返回类型:string