chrome.automation
- Description
The
chrome.automation
API allows developers to access the automation (accessibility) tree for the browser. The tree resembles the DOM tree, but only exposes the semantic structure of a page. It can be used to programmatically interact with a page by examining names, roles, and states, listening for events, and performing actions on nodes. - AvailabilityDev channel only.
Summary
- Types
- Methods
chrome.automation.addTreeChangeObserver(filter: TreeChangeObserverFilter, observer: function)
chrome.automation.getAccessibilityFocus(callback: function)
chrome.automation.getDesktop(callback: function)
chrome.automation.getFocus(callback: function)
chrome.automation.getTree(tabId: number, callback: function)
chrome.automation.removeTreeChangeObserver(observer: function)
chrome.automation.setDocumentSelection(params: SetDocumentSelectionParams)
Types
AutomationEvent
Properties
- eventFromstring
The source of this event.
- intents
A list of
AutomationIntent
s associated with this event. - mouseXnumber
Any mouse coordinates associated with this event.
- mouseYnumber
- stopPropagationfunction
Stops this event from further processing except for any remaining listeners on
AutomationEvent.target
.The stopPropagation function looks like this:
stopPropagation() => {...}
- target
The
AutomationNode
to which the event was targeted. - type
The type of the event.
AutomationIntent
Properties
- command
A command associated with this AutomationIntent.
- moveDirection
A move direction associated with this AutomationIntent.
- textBoundary
A text boundary associated with this AutomationIntent.
AutomationNode
Properties
- accessKeystring optional
The key that activates this widget.
- activeDescendantAutomationNode optional
The node referred to by
aria-activedescendant
, where applicable - activeDescendantForAutomationNode[] optional
Reverse relationship for active descendant.
- addEventListenerfunction
Adds a listener for the given event type and event phase.
The addEventListener function looks like this:
addEventListener(eventType: EventType, listener: function, capture: boolean) => {...}
- eventType
- listenerfunction
A listener for events on an
AutomationNode
.The listener function looks like this:
listener(event: AutomationEvent) => {...}
- event
- captureboolean
- anchorAffinitystring optional
The affinity of the tree selection anchor, if any.
- anchorObjectAutomationNode optional
The anchor node of the tree selection, if any.
- anchorOffsetnumber optional
The anchor offset of the tree selection, if any.
- ariaColumnCountnumber optional
The number of columns in this table as specified by the page author.
- ariaInvalidValuestring optional
The value of the aria-invalid attribute, indicating the error type.
- ariaRowCountnumber optional
The number of rows in this table as specified by the page author.
- autoCompletestring optional
Aria auto complete.
- backgroundColornumber optional
The RGBA background color of this subtree, as an integer.
- boldboolean
Indicates node text is bold.
- boundsForRangefunction
Determines the location of the text within the node specified by |startIndex| and |endIndex|, inclusively. Invokes |callback| with the bounding rectangle, in screen coordinates. |callback| can be invoked either synchronously or asynchronously. The bounds are clipped to ancestors.
The boundsForRange function looks like this:
boundsForRange(startIndex: number, endIndex: number, callback: function) => {...}
- busyboolean optional
The value of aria-busy for a live region or any other element.
- checkedstring optional
Tri-state describing checkbox or radio button: 'false' | 'true' | 'mixed'
- checkedStateDescriptionstring optional
Description of the state of the checkbox. Used only when the node is checkable.
- children
Walking the tree.
- classNamestring optional
The name of the programmatic backing object.
- colornumber optional
The RGBA foreground color of this subtree, as an integer.
- colorValuenumber optional
The RGBA color of an input element whose value is a color.
- containerLiveAtomicboolean optional
The value of aria-atomic if this node is inside a live region.
- containerLiveBusyboolean optional
The value of aria-busy if this node is inside a live region.
- containerLiveRelevantstring optional
The value of aria-relevant if this node is inside a live region.
- containerLiveStatusstring optional
The type of live region if this node is inside a live region.
- controlledByAutomationNode[] optional
Reverse relationship for controls.
- controlsAutomationNode[] optional
The nodes, if any, which this node is specified to control via
aria-controls
. - createPositionfunction
Creates a position object backed by Chrome's accessibility position support.
The createPosition function looks like this:
createPosition(offset: number, isUpstream: boolean): AutomationPosition => {...}
- offsetnumber
- isUpstreamboolean
- returns
- customActionsCustomAction[] optional
An array of custom actions.
- defaultActionVerbDefaultActionVerb optional
The action taken by calling
doDefault
. - describedByAutomationNode[] optional
The nodes, if any, which form a description for this node.
- descriptionstring optional
The purpose of the node, other than the role, if any.
- descriptionForAutomationNode[] optional
Reverse relationship for describedBy.
- detailsAutomationNode[] optional
A node that provides more details about the current node.
- detailsForAutomationNode[] optional
Reverse relationship for details.
- detectedLanguagestring optional
The detected language code for this subtree.
- displaystring optional
The CSS display attribute for this node, if applicable.
- doDefaultfunction
Does the default action based on this node's role. This is generally the same action that would result from clicking the node such as expanding a treeitem, toggling a checkbox, selecting a radiobutton, or activating a button.
The doDefault function looks like this:
doDefault() => {...}
- docLoadedboolean optional
Whether this document has finished loading.
- docLoadingProgressnumber optional
The proportion (out of 1.0) that this doc has completed loading.
- docTitlestring optional
The title of this document.
- docUrlstring optional
The URL of this document.
- domQuerySelectorfunction
Gets the first node in this node's subtree which matches the given CSS selector and is within the same DOM context.
If this node doesn't correspond directly with an HTML node in the DOM, querySelector will be run on this node's nearest HTML node ancestor. Note that this may result in the query returning a node which is not a descendant of this node.
If the selector matches a node which doesn't directly correspond to an automation node (for example an element within an ARIA widget, where the ARIA widget forms one node of the automation tree, or an element which is hidden from accessibility via hiding it using CSS or using aria-hidden), this will return the nearest ancestor which does correspond to an automation node.
The domQuerySelector function looks like this:
domQuerySelector(selector: string, callback: function) => {...}
- selectorstring
- callbackfunction
The callback parameter should be a function that looks like this:
(node: AutomationNode) => {...}
- node
- editableRootboolean
Indicates whether this is a root of an editable subtree.
- errorMessageAutomationNode optional
A node that provides an error message for a current node.
- errorMessageForAutomationNode[] optional
Reverse relationship for errorMessage.
- findfunction
Finds the first AutomationNode in this node's subtree which matches the given search parameters.
The find function looks like this:
find(params: FindParams): AutomationNode => {...}
- params
- returns
- findAllfunction
Finds all the AutomationNodes in this node's subtree which matches the given search parameters.
The findAll function looks like this:
findAll(params: FindParams): AutomationNode[] => {...}
- params
- returns
- firstChildAutomationNode optional
- flowFromAutomationNode[] optional
Reverse relationship for flowTo.
- flowToAutomationNode[] optional
The nodes, if any, which may optionally be navigated to after this one. See
aria-flowto
. - focusfunction
Places focus on this node.
The focus function looks like this:
focus() => {...}
- focusAffinitystring optional
The affinity of the tree selection focus, if any.
- focusObjectAutomationNode optional
The focus node of the tree selection, if any.
- focusOffsetnumber optional
The focus offset of the tree selection, if any.
- fontFamilystring
Indicates the font family.
- fontSizenumber optional
Indicates the font size of this node.
- getImageDatafunction
Request a data url for the contents of an image, optionally resized. Pass zero for maxWidth and/or maxHeight for the original size.
The getImageData function looks like this:
getImageData(maxWidth: number, maxHeight: number) => {...}
- maxWidthnumber
- maxHeightnumber
- getNextTextMatchfunction
The getNextTextMatch function looks like this:
getNextTextMatch(searchStr: string, backward: boolean): AutomationNode => {...}
- searchStrstring
- backwardboolean
- returns
- hasPopupstring optional
Indicates the availability and type of interactive popup element true - the popup is a menu menu - the popup is a menu listbox - the popup is a listbox tree - the popup is a tree grid - the popup is a grid dialog - the popup is a dialog
- hierarchicalLevelnumber optional
The level of a heading or tree item.
- hitTestfunction
- hitTestWithReplyfunction
Does a
AutomationNode.hitTest
, and receives a callback with the resulting hit node.The hitTestWithReply function looks like this:
hitTestWithReply(x: number, y: number, callback: function) => {...}
- xnumber
- ynumber
- callbackfunction
The callback parameter should be a function that looks like this:
(node: AutomationNode) => {...}
- node
- htmlAttributesobject optional
A map containing all HTML attributes and their values
- htmlTagstring optional
The HTML tag for this element, if this node is an HTML element.
- imageAnnotationstring optional
The image annotation for image nodes, which may be a human-readable string that is the contextualized annotation or a status string related to annotations.
- imageDataUrlstring optional
A data url with the contents of this object's image or thumbnail.
- inPageLinkTargetAutomationNode optional
The target of an in-page link.
- indexInParentnumber optional
The index of this node in its parent node's list of children. If this is the root node, this will be undefined.
- innerHtmlstring optional
The inner html of this element. Only populated for math content.
- inputTypestring optional
The input type of a text field, such as "text" or "email".
- isRootNodeboolean
Whether this AutomationNode is a root node.
- isSelectionBackwardboolean optional
If a selection is present, whether the anchor of the selection comes after its focus in the accessibility tree.
- italicboolean
Indicates node text is italic.
- labelForAutomationNode[] optional
Reverse relationship for labelledBy.
- labelledByAutomationNode[] optional
The nodes, if any, which form a label for this element. Generally, the text from these elements will also be exposed as the element's accessible name, via the
AutomationNode.name
attribute. - languagestring optional
The author-provided language code for this subtree.
- languageAnnotationForStringAttributefunction
Returns the detected languages for the provided string attribute as an array of LanguageSpan objects. There are several guarantees about the format of the LanguageSpan array: 1. Is either empty or contains LanguageSpans that cover all indices in the associated string attribute value. 2. Is sorted by increasing startIndex (those with smaller startIndex appear first). 3. LanguageSpans are non-overlapping and contain exactly one language.
The languageAnnotationForStringAttribute function looks like this:
languageAnnotationForStringAttribute(attribute: string): LanguageSpan[] => {...}
- attributestring
- returns
- lastChildAutomationNode optional
- lineThroughboolean
Indicates node text is line through.
- liveAtomicboolean optional
The value of aria-atomic for a live region.
- liveRelevantstring optional
The value of aria-relevant for a live region.
- liveStatusstring optional
The type of region if this is the root of a live region. Possible values are 'polite' and 'assertive'.
- locationRect optional
The rendered location (as a bounding box) of this node in global screen coordinates.
- makeVisiblefunction
Scrolls this node to make it visible.
The makeVisible function looks like this:
makeVisible() => {...}
- markersMarker[] optional
An array of Marker objects for this node.
- matchesfunction
Returns whether this node matches the given
FindParams
.The matches function looks like this:
matches(params: FindParams): boolean => {...}
- params
- returnsboolean
- maxValueForRangenumber optional
The maximum possible value for this range.
- minValueForRangenumber optional
The minimum possible value for this range.
- modalboolean optional
Marks this subtree as modal.
- namestring optional
The accessible name for this node, via the Accessible Name Calculation process.
- nameFromNameFromType optional
The source of the name.
- nextFocusAutomationNode optional
- nextOnLineAutomationNode optional
- nextSiblingAutomationNode optional
- nonInlineTextWordEndsnumber[] optional
The end index of each word within the node's name. This is different from wordEnds because it is not restricted to inline text boxes and can be used for any type of element.
- nonInlineTextWordStartsnumber[] optional
The start index of each word within the node's name. This is different from wordStarts because it is not restricted to inline text boxes and can be used for any type of element.
- notUserSelectableStyleboolean optional
Indicates that the node is marked user-select:none
- parentAutomationNode optional
- performCustomActionfunction
Performs custom action.
The performCustomAction function looks like this:
performCustomAction(customActionId: number) => {...}
- customActionIdnumber
- performStandardActionfunction
Convenience method to perform a standard action supported by this node. For actions requiring additional arguments, call the specific binding e.g.
setSelection
.The performStandardAction function looks like this:
performStandardAction(actionType: ActionType) => {...}
- actionType
- placeholderstring optional
The placeholder for this text field, if any.
- posInSetnumber optional
The 1-based index of an item in a set.
- previousFocusAutomationNode optional
- previousOnLineAutomationNode optional
- previousSiblingAutomationNode optional
- removeEventListenerfunction
Removes a listener for the given event type and event phase.
The removeEventListener function looks like this:
removeEventListener(eventType: EventType, listener: function, capture: boolean) => {...}
- eventType
- listenerfunction
A listener for events on an
AutomationNode
.The listener function looks like this:
listener(event: AutomationEvent) => {...}
- event
- captureboolean
- replaceSelectedTextfunction
Replaces the selected text within a text field.
The replaceSelectedText function looks like this:
replaceSelectedText(value: string) => {...}
- valuestring
- restrictionstring optional
Input restriction, if any, such as readonly or disabled: undefined - enabled control or other object that is not disabled Restriction.DISABLED - disallows input in itself + any descendants Restriction.READONLY - allow focus/selection but not input
- resumeMediafunction
Resume playing any media within this tree.
The resumeMedia function looks like this:
resumeMedia() => {...}
- roleRoleType optional
The role of this node.
- roleDescriptionstring optional
The role description for this node.
- rootAutomationNode optional
The root node of the tree containing this AutomationNode.
- scrollBackwardfunction
Scrolls this scrollable container backward.
The scrollBackward function looks like this:
scrollBackward(callback: function) => {...}
- callbackfunction
The callback parameter should be a function that looks like this:
(result: boolean) => {...}
- resultboolean
- scrollDownfunction
Scrolls this scrollable container down.
The scrollDown function looks like this:
scrollDown(callback: function) => {...}
- callbackfunction
The callback parameter should be a function that looks like this:
(result: boolean) => {...}
- resultboolean
- scrollForwardfunction
Scrolls this scrollable container forward.
The scrollForward function looks like this:
scrollForward(callback: function) => {...}
- callbackfunction
The callback parameter should be a function that looks like this:
(result: boolean) => {...}
- resultboolean
- scrollLeftfunction
Scrolls this scrollable container left.
The scrollLeft function looks like this:
scrollLeft(callback: function) => {...}
- callbackfunction
The callback parameter should be a function that looks like this:
(result: boolean) => {...}
- resultboolean
- scrollRightfunction
Scrolls this scrollable container right.
The scrollRight function looks like this:
scrollRight(callback: function) => {...}
- callbackfunction
The callback parameter should be a function that looks like this:
(result: boolean) => {...}
- resultboolean
- scrollToPointfunction
Scrolls this scrollable container to the given point.
The scrollToPoint function looks like this:
scrollToPoint(x: number, y: number) => {...}
- xnumber
- ynumber
- scrollUpfunction
Scrolls this scrollable container up.
The scrollUp function looks like this:
scrollUp(callback: function) => {...}
- callbackfunction
The callback parameter should be a function that looks like this:
(result: boolean) => {...}
- resultboolean
- scrollXnumber optional
Scrollable container attributes.
- scrollXMaxnumber optional
- scrollXMinnumber optional
- scrollYnumber optional
- scrollYMaxnumber optional
- scrollYMinnumber optional
- scrollableboolean optional
Indicates whether this node is scrollable.
- selectedboolean optional
Indicates whether this node is selected, unselected, or neither.
- selectionEndAffinitystring optional
The affinity of the tree selection end, if any.
- selectionEndObjectAutomationNode optional
The selection end node of the tree selection, if any.
- selectionEndOffsetnumber optional
The selection end offset of the tree selection, if any.
- selectionStartAffinitystring optional
The affinity of the tree selection start, if any.
- selectionStartObjectAutomationNode optional
The selection start node of the tree selection, if any.
- selectionStartOffsetnumber optional
The selection start offset of the tree selection, if any.
- sentenceEndsnumber[] optional
The end indexes of each sentence within the node's name. For most nodes, the size of sentenceStarts array should be equal to the size of sentenceEnds array. Two exceptions are (1) node at the begining of a paragraph but the end of the node's sentences is in its following node. Such a node has one more start index. (2) Node at the end of a paragraph but the start of the node's sentences is in its previous node. Such a node has one more end index. For example, <p><b>Hello</b> world.</p> has two nodes. The first one has one start index (i.e., 0) but no end index. The second node has one end index (i.e., 7) but no start index.
- sentenceStartsnumber[] optional
The start indexes of each sentence within the node's name.
- setAccessibilityFocusfunction
Sets accessibility focus. Accessibility focus is the node on which an extension tracks a user's focus. This may be conveyed through a focus ring or or speech output by the extension. Automation will dispatch more events to the accessibility focus such as location changes.
The setAccessibilityFocus function looks like this:
setAccessibilityFocus() => {...}
- setScrollOffsetfunction
Sets this scrollable container's scroll offset.
The setScrollOffset function looks like this:
setScrollOffset(x: number, y: number) => {...}
- xnumber
- ynumber
- setSelectionfunction
Sets selection within a text field.
The setSelection function looks like this:
setSelection(startIndex: number, endIndex: number) => {...}
- startIndexnumber
- endIndexnumber
- setSequentialFocusNavigationStartingPointfunction
Clears focus and sets this node as the starting point for the next time the user presses Tab or Shift+Tab.
The setSequentialFocusNavigationStartingPoint function looks like this:
setSequentialFocusNavigationStartingPoint() => {...}
- setSizenumber optional
The number of items in a set;
- setValuefunction
Sets the value of a text field.
The setValue function looks like this:
setValue(value: string) => {...}
- valuestring
- showContextMenufunction
Show the context menu for this element, as if the user right-clicked.
The showContextMenu function looks like this:
showContextMenu() => {...}
- sortDirection
The sort direction of this node.
- standardActionsActionType[] optional
An array of standard actions available on this node.
- startDuckingMediafunction
Start ducking any media within this tree.
The startDuckingMedia function looks like this:
startDuckingMedia() => {...}
- stateobject optional
The
StateType
s describing this node. - stopDuckingMediafunction
Stop ducking any media within this tree.
The stopDuckingMedia function looks like this:
stopDuckingMedia() => {...}
- subscriptboolean
Indicates node text is subscript.
- superscriptboolean
Indicates node text is superscript.
- suspendMediafunction
Suspend any media playing within this tree.
The suspendMedia function looks like this:
suspendMedia() => {...}
- tableCellAriaColumnIndexnumber optional
The ARIA column index as specified by the page author.
- tableCellAriaRowIndexnumber optional
The ARIA row index as specified by the page author.
- tableCellColumnHeadersAutomationNode[] optional
The column header nodes for a table cell.
- tableCellColumnIndexnumber optional
The zero-based index of the column that this cell is in as specified in the DOM.
- tableCellColumnSpannumber optional
The number of columns that this cell spans (default is 1).
- tableCellRowHeadersAutomationNode[] optional
The row header nodes for a table cell.
- tableCellRowIndexnumber optional
The zero-based index of the row that this cell is in as specified in the DOM.
- tableCellRowSpannumber optional
The number of rows that this cell spans (default is 1).
- tableColumnCountnumber optional
The number of columns in this table as specified in the DOM.
- tableColumnHeaderAutomationNode optional
The corresponding column header for this cell.
- tableColumnIndexnumber optional
The column index of this column node.
- tableRowCountnumber optional
The number of rows in this table as specified in the DOM.
- tableRowHeaderAutomationNode optional
The corresponding row header for this cell.
- tableRowIndexnumber optional
The row index of this row node.
- textInputTypestring optional
The input type, like email or number.
- textSelEndnumber optional
The character index of the end of the selection within this editable text element; -1 if no selection.
- textSelStartnumber optional
The character index of the start of the selection within this editable text element; -1 if no selection.
- tooltipstring optional
The tooltip of the node, if any.
- unclippedBoundsForRangefunction
Determines the location of the text within the node specified by |startIndex| and |endIndex|, inclusively. Invokes |callback| with the bounding rectangle, in screen coordinates. |callback| can be invoked either synchronously or asynchronously. The bounds are not clipped to ancestors.
The unclippedBoundsForRange function looks like this:
unclippedBoundsForRange(startIndex: number, endIndex: number, callback: function) => {...}
- unclippedLocationRect optional
The location (as a bounding box) of this node in global screen coordinates without applying any clipping from ancestors.
- underlineboolean
Indicates node text is underline.
- urlstring optional
The URL that this link will navigate to.
- valuestring optional
The value for this node: for example the
value
attribute of an<input> element.
- valueForRangenumber optional
The current value for this range.
- wordEndsnumber[] optional
- wordStartsnumber[] optional
The start and end index of each word in an inline text box.
AutomationPosition
Properties
- affinitystring
- asLeafTextPositionfunction
The asLeafTextPosition function looks like this:
asLeafTextPosition() => {...}
- asTextPositionfunction
The asTextPosition function looks like this:
asTextPosition() => {...}
- asTreePositionfunction
The asTreePosition function looks like this:
asTreePosition() => {...}
- atEndOfAnchorfunction
The atEndOfAnchor function looks like this:
atEndOfAnchor(): boolean => {...}
- returnsboolean
- atEndOfDocumentfunction
The atEndOfDocument function looks like this:
atEndOfDocument(): boolean => {...}
- returnsboolean
- atEndOfFormatfunction
The atEndOfFormat function looks like this:
atEndOfFormat(): boolean => {...}
- returnsboolean
- atEndOfLinefunction
The atEndOfLine function looks like this:
atEndOfLine(): boolean => {...}
- returnsboolean
- atEndOfPagefunction
The atEndOfPage function looks like this:
atEndOfPage(): boolean => {...}
- returnsboolean
- atEndOfParagraphfunction
The atEndOfParagraph function looks like this:
atEndOfParagraph(): boolean => {...}
- returnsboolean
- atEndOfWordfunction
The atEndOfWord function looks like this:
atEndOfWord(): boolean => {...}
- returnsboolean
- atStartOfAnchorfunction
The atStartOfAnchor function looks like this:
atStartOfAnchor(): boolean => {...}
- returnsboolean
- atStartOfDocumentfunction
The atStartOfDocument function looks like this:
atStartOfDocument(): boolean => {...}
- returnsboolean
- atStartOfFormatfunction
The atStartOfFormat function looks like this:
atStartOfFormat(): boolean => {...}
- returnsboolean
- atStartOfLinefunction
The atStartOfLine function looks like this:
atStartOfLine(): boolean => {...}
- returnsboolean
- atStartOfPagefunction
The atStartOfPage function looks like this:
atStartOfPage(): boolean => {...}
- returnsboolean
- atStartOfParagraphfunction
The atStartOfParagraph function looks like this:
atStartOfParagraph(): boolean => {...}
- returnsboolean
- atStartOfWordfunction
The atStartOfWord function looks like this:
atStartOfWord(): boolean => {...}
- returnsboolean
- childIndexnumber
- getTextfunction
The getText function looks like this:
getText(): string => {...}
- returnsstring
- isInLineBreakfunction
The isInLineBreak function looks like this:
isInLineBreak(): boolean => {...}
- returnsboolean
- isInTextObjectfunction
The isInTextObject function looks like this:
isInTextObject(): boolean => {...}
- returnsboolean
- isInWhiteSpacefunction
The isInWhiteSpace function looks like this:
isInWhiteSpace(): boolean => {...}
- returnsboolean
- isLeafTextPositionfunction
The isLeafTextPosition function looks like this:
isLeafTextPosition(): boolean => {...}
- returnsboolean
- isNullPositionfunction
The isNullPosition function looks like this:
isNullPosition(): boolean => {...}
- returnsboolean
- isTextPositionfunction
The isTextPosition function looks like this:
isTextPosition(): boolean => {...}
- returnsboolean
- isTreePositionfunction
The isTreePosition function looks like this:
isTreePosition(): boolean => {...}
- returnsboolean
- isValidfunction
The isValid function looks like this:
isValid(): boolean => {...}
- returnsboolean
- maxTextOffsetfunction
The maxTextOffset function looks like this:
maxTextOffset(): number => {...}
- returnsnumber
- moveToNextAnchorPositionfunction
The moveToNextAnchorPosition function looks like this:
moveToNextAnchorPosition() => {...}
- moveToNextCharacterPositionfunction
The moveToNextCharacterPosition function looks like this:
moveToNextCharacterPosition() => {...}
- moveToNextFormatEndPositionfunction
The moveToNextFormatEndPosition function looks like this:
moveToNextFormatEndPosition() => {...}
- moveToNextLeafTextPositionfunction
The moveToNextLeafTextPosition function looks like this:
moveToNextLeafTextPosition() => {...}
- moveToNextLeafTreePositionfunction
The moveToNextLeafTreePosition function looks like this:
moveToNextLeafTreePosition() => {...}
- moveToNextLineEndPositionfunction
The moveToNextLineEndPosition function looks like this:
moveToNextLineEndPosition() => {...}
- moveToNextLineStartPositionfunction
The moveToNextLineStartPosition function looks like this:
moveToNextLineStartPosition() => {...}
- moveToNextPageEndPositionfunction
The moveToNextPageEndPosition function looks like this:
moveToNextPageEndPosition() => {...}
- moveToNextPageStartPositionfunction
The moveToNextPageStartPosition function looks like this:
moveToNextPageStartPosition() => {...}
- moveToNextParagraphEndPositionfunction
The moveToNextParagraphEndPosition function looks like this:
moveToNextParagraphEndPosition() => {...}
- moveToNextParagraphStartPositionfunction
The moveToNextParagraphStartPosition function looks like this:
moveToNextParagraphStartPosition() => {...}
- moveToNextWordEndPositionfunction
The moveToNextWordEndPosition function looks like this:
moveToNextWordEndPosition() => {...}
- moveToNextWordStartPositionfunction
The moveToNextWordStartPosition function looks like this:
moveToNextWordStartPosition() => {...}
- moveToParentPositionfunction
The moveToParentPosition function looks like this:
moveToParentPosition() => {...}
- moveToPositionAtEndOfAnchorfunction
The moveToPositionAtEndOfAnchor function looks like this:
moveToPositionAtEndOfAnchor() => {...}
- moveToPositionAtEndOfDocumentfunction
The moveToPositionAtEndOfDocument function looks like this:
moveToPositionAtEndOfDocument() => {...}
- moveToPositionAtStartOfAnchorfunction
The moveToPositionAtStartOfAnchor function looks like this:
moveToPositionAtStartOfAnchor() => {...}
- moveToPositionAtStartOfDocumentfunction
The moveToPositionAtStartOfDocument function looks like this:
moveToPositionAtStartOfDocument() => {...}
- moveToPreviousAnchorPositionfunction
The moveToPreviousAnchorPosition function looks like this:
moveToPreviousAnchorPosition() => {...}
- moveToPreviousCharacterPositionfunction
The moveToPreviousCharacterPosition function looks like this:
moveToPreviousCharacterPosition() => {...}
- moveToPreviousFormatStartPositionfunction
The moveToPreviousFormatStartPosition function looks like this:
moveToPreviousFormatStartPosition() => {...}
- moveToPreviousLeafTextPositionfunction
The moveToPreviousLeafTextPosition function looks like this:
moveToPreviousLeafTextPosition() => {...}
- moveToPreviousLeafTreePositionfunction
The moveToPreviousLeafTreePosition function looks like this:
moveToPreviousLeafTreePosition() => {...}
- moveToPreviousLineEndPositionfunction
The moveToPreviousLineEndPosition function looks like this:
moveToPreviousLineEndPosition() => {...}
- moveToPreviousLineStartPositionfunction
The moveToPreviousLineStartPosition function looks like this:
moveToPreviousLineStartPosition() => {...}
- moveToPreviousPageEndPositionfunction
The moveToPreviousPageEndPosition function looks like this:
moveToPreviousPageEndPosition() => {...}
- moveToPreviousPageStartPositionfunction
The moveToPreviousPageStartPosition function looks like this:
moveToPreviousPageStartPosition() => {...}
- moveToPreviousParagraphEndPositionfunction
The moveToPreviousParagraphEndPosition function looks like this:
moveToPreviousParagraphEndPosition() => {...}
- moveToPreviousParagraphStartPositionfunction
The moveToPreviousParagraphStartPosition function looks like this:
moveToPreviousParagraphStartPosition() => {...}
- moveToPreviousWordEndPositionfunction
The moveToPreviousWordEndPosition function looks like this:
moveToPreviousWordEndPosition() => {...}
- moveToPreviousWordStartPositionfunction
The moveToPreviousWordStartPosition function looks like this:
moveToPreviousWordStartPosition() => {...}
- nodeAutomationNode optional
- textOffsetnumber
CustomAction
Properties
- descriptionstring
- idnumber
FindParams
Properties
- attributesobject optional
A map of attribute name to expected value, for example
{ name: 'Root directory', checkbox_mixed: true }
. String attribute values may be specified as a regex, for example{ name: /stralia$/
}. Unless specifying a regex, the expected value must be an exact match in type and value for the actual value. Thus, the type of expected value must be one of:- string
- integer
- float
- boolean
- roleRoleType optional
- stateobject optional
A map of
StateType
to boolean, indicating for each state whether it should be set or not. For example:{ StateType.disabled: false }
would only match ifStateType.disabled
was not present in the node'sstate
object.
LanguageSpan
Properties
- endIndexnumber
Exclusive end index of substring that contains language.
- languagestring
Detected language for substring.
- probabilitynumber
Probability that language is correct.
- startIndexnumber
Inclusive start index of substring that contains language.
Marker
Properties
- endOffsetnumber
The end offset within the text of the associated node.
- flagsobject
A mapping of MarkerType to true or undefined indicating the marker types for this marker.
- startOffsetnumber
The start offset within the text of the associated node.
Rect
Properties
- heightnumber
- leftnumber
- topnumber
- widthnumber
SetDocumentSelectionParams
Properties
- anchorObject
The node where the selection begins.
- anchorOffsetnumber
The offset in the anchor node where the selection begins.
- focusObject
The node where the selection ends.
- focusOffsetnumber
The offset within the focus node where the selection ends.
TreeChange
Properties
- target
The
AutomationNode
that changed. - type
The type of change.
ActionType
All possible actions that can be performed on automation nodes.
Enum
"annotatePageImages"
, "blur"
, "clearAccessibilityFocus"
, "collapse"
, "customAction"
, "decrement"
, "doDefault"
, "expand"
, "focus"
, "getImageData"
, "getTextLocation"
, "hideTooltip"
, "hitTest"
, "increment"
, "internalInvalidateTree"
, "loadInlineTextBoxes"
, "replaceSelectedText"
, "scrollBackward"
, "scrollDown"
, "scrollForward"
, "scrollLeft"
, "scrollRight"
, "scrollUp"
, "scrollToMakeVisible"
, "scrollToPoint"
, "setAccessibilityFocus"
, "setScrollOffset"
, "setSelection"
, "setSequentialFocusNavigationStartingPoint"
, "setValue"
, "showContextMenu"
, "signalEndOfTest"
, or "showTooltip"
DefaultActionVerb
Describes possible actions when performing a do default action.
Enum
"activate"
, "check"
, "click"
, "clickAncestor"
, "jump"
, "open"
, "press"
, "select"
, or "uncheck"
DescriptionFromType
Enum
"uninitialized"
, "attribute"
, "contents"
, "relatedElement"
, or "title"
EventType
Possible events fired on an AutomationNode
.
Enum
"accessKeyChanged"
, "activeDescendantChanged"
, "alert"
, "ariaAttributeChanged"
, "ariaCurrentChanged"
, "atomicChanged"
, "autoCompleteChanged"
, "autocorrectionOccured"
, "blur"
, "busyChanged"
, "checkedStateChanged"
, "childrenChanged"
, "classNameChanged"
, "clicked"
, "collapsed"
, "controlsChanged"
, "describedByChanged"
, "descriptionChanged"
, "documentSelectionChanged"
, "documentTitleChanged"
, "dropeffectChanged"
, "editableTextChanged"
, "enabledChanged"
, "endOfTest"
, "expanded"
, "expandedChanged"
, "flowFromChanged"
, "flowToChanged"
, "focus"
, "focusAfterMenuClose"
, "focusChanged"
, "focusContext"
, "grabbedChanged"
, "haspopupChanged"
, "hide"
, "hierarchicalLevelChanged"
, "hitTestResult"
, "hover"
, "ignoredChanged"
, "imageAnnotationChanged"
, "imageFrameUpdated"
, "invalidStatusChanged"
, "keyShortcutsChanged"
, "labeledByChanged"
, "languageChanged"
, "layoutComplete"
, "layoutInvalidated"
, "liveRegionChanged"
, "liveRegionCreated"
, "liveRegionNodeChanged"
, "liveRelevantChanged"
, "liveStatusChanged"
, "loadComplete"
, "loadStart"
, "locationChanged"
, "mediaStartedPlaying"
, "mediaStoppedPlaying"
, "menuEnd"
, "menuItemSelected"
, "menuListItemSelected"
, "menuListValueChanged"
, "menuPopupEnd"
, "menuPopupStart"
, "menuStart"
, "mouseCanceled"
, "mouseDragged"
, "mouseMoved"
, "mousePressed"
, "mouseReleased"
, "multilineStateChanged"
, "multiselectableStateChanged"
, "nameChanged"
, "objectAttributeChanged"
, "otherAttributeChanged"
, "parentChanged"
, "placeholderChanged"
, "portalActivated"
, "positionInSetChanged"
, "rangeValueChanged"
, "rangeValueMaxChanged"
, "rangeValueMinChanged"
, "rangeValueStepChanged"
, "readonlyChanged"
, "relatedNodeChanged"
, "requiredStateChanged"
, "roleChanged"
, "rowCollapsed"
, "rowCountChanged"
, "rowExpanded"
, "scrollHorizontalPositionChanged"
, "scrollPositionChanged"
, "scrollVerticalPositionChanged"
, "scrolledToAnchor"
, "selectedChanged"
, "selectedChildrenChanged"
, "selectedValueChanged"
, "selection"
, "selectionAdd"
, "selectionInTextFieldChanged"
, "selectionRemove"
, "setSizeChanged"
, "show"
, "sortChanged"
, "stateChanged"
, "subtreeCreated"
, "textAttributeChanged"
, "textSelectionChanged"
, "textChanged"
, "tooltipClosed"
, "tooltipOpened"
, "treeChanged"
, "valueInTextFieldChanged"
, "valueChanged"
, "windowActivated"
, "windowDeactivated"
, or "windowVisibilityChanged"
HasPopup
Indicates the availability and type of interactive popup element
Enum
"true"
, "menu"
, "listbox"
, "tree"
, "grid"
, or "dialog"
IntentCommandType
A command associated with an AutomationIntent
.
Enum
"clearSelection"
, "delete"
, "dictate"
, "extendSelection"
, "format"
, "history"
, "insert"
, "marker"
, "moveSelection"
, or "setSelection"
IntentInputEventType
The type of an input event associated with an AutomationIntent
. It describes an edit command, e.g. IntentCommandType.insert, in more detail.
Enum
"insertText"
, "insertLineBreak"
, "insertParagraph"
, "insertOrderedList"
, "insertUnorderedList"
, "insertHorizontalRule"
, "insertFromPaste"
, "insertFromDrop"
, "insertFromYank"
, "insertTranspose"
, "insertReplacementText"
, "insertCompositionText"
, "deleteWordBackward"
, "deleteWordForward"
, "deleteSoftLineBackward"
, "deleteSoftLineForward"
, "deleteHardLineBackward"
, "deleteHardLineForward"
, "deleteContentBackward"
, "deleteContentForward"
, "deleteByCut"
, "deleteByDrag"
, "historyUndo"
, "historyRedo"
, "formatBold"
, "formatItalic"
, "formatUnderline"
, "formatStrikeThrough"
, "formatSuperscript"
, "formatSubscript"
, "formatJustifyCenter"
, "formatJustifyFull"
, "formatJustifyRight"
, "formatJustifyLeft"
, "formatIndent"
, "formatOutdent"
, "formatRemove"
, or "formatSetBlockTextDirection"
IntentMoveDirectionType
A move direction associated with an AutomationIntent
.
Enum
"backward"
, or "forward"
IntentTextBoundaryType
A text boundary associated with an AutomationIntent
.
Enum
"character"
, "format"
, "lineEnd"
, "lineStart"
, "lineStartOrEnd"
, "object"
, "pageEnd"
, "pageStart"
, "pageStartOrEnd"
, "paragraphEnd"
, "paragraphStart"
, "paragraphStartOrEnd"
, "sentenceEnd"
, "sentenceStart"
, "sentenceStartOrEnd"
, "webPage"
, "wordEnd"
, "wordStart"
, or "wordStartOrEnd"
MarkerType
Types of markers on text. See AutomationNode.markerTypes
.
Enum
"spelling"
, "grammar"
, "textMatch"
, "activeSuggestion"
, or "suggestion"
NameFromType
Where the node's name is from.
Enum
"uninitialized"
, "attribute"
, "attributeExplicitlyEmpty"
, "caption"
, "contents"
, "placeholder"
, "relatedElement"
, "title"
, or "value"
Restriction
The input restriction for a object -- even non-controls can be disabled.
Enum
"disabled"
, or "readOnly"
RoleType
Describes the purpose of an AutomationNode
.
Enum
"abbr"
, "alert"
, "alertDialog"
, "anchor"
, "application"
, "article"
, "audio"
, "banner"
, "blockquote"
, "button"
, "canvas"
, "caption"
, "caret"
, "cell"
, "checkBox"
, "client"
, "code"
, "colorWell"
, "column"
, "columnHeader"
, "comboBoxGrouping"
, "comboBoxMenuButton"
, "comment"
, "complementary"
, "contentDeletion"
, "contentInsertion"
, "contentInfo"
, "date"
, "dateTime"
, "definition"
, "descriptionList"
, "descriptionListDetail"
, "descriptionListTerm"
, "desktop"
, "details"
, "dialog"
, "directory"
, "disclosureTriangle"
, "docAbstract"
, "docAcknowledgments"
, "docAfterword"
, "docAppendix"
, "docBackLink"
, "docBiblioEntry"
, "docBibliography"
, "docBiblioRef"
, "docChapter"
, "docColophon"
, "docConclusion"
, "docCover"
, "docCredit"
, "docCredits"
, "docDedication"
, "docEndnote"
, "docEndnotes"
, "docEpigraph"
, "docEpilogue"
, "docErrata"
, "docExample"
, "docFootnote"
, "docForeword"
, "docGlossary"
, "docGlossRef"
, "docIndex"
, "docIntroduction"
, "docNoteRef"
, "docNotice"
, "docPageBreak"
, "docPageFooter"
, "docPageHeader"
, "docPageList"
, "docPart"
, "docPreface"
, "docPrologue"
, "docPullquote"
, "docQna"
, "docSubtitle"
, "docTip"
, "docToc"
, "document"
, "embeddedObject"
, "emphasis"
, "feed"
, "figcaption"
, "figure"
, "footer"
, "footerAsNonLandmark"
, "form"
, "genericContainer"
, "graphicsDocument"
, "graphicsObject"
, "graphicsSymbol"
, "grid"
, "group"
, "header"
, "headerAsNonLandmark"
, "heading"
, "iframe"
, "iframePresentational"
, "ignored"
, "image"
, "imageMap"
, "imeCandidate"
, "inlineTextBox"
, "inputTime"
, "keyboard"
, "labelText"
, "layoutTable"
, "layoutTableCell"
, "layoutTableRow"
, "legend"
, "lineBreak"
, "link"
, "list"
, "listBox"
, "listBoxOption"
, "listGrid"
, "listItem"
, "listMarker"
, "log"
, "main"
, "mark"
, "marquee"
, "math"
, "menu"
, "menuBar"
, "menuItem"
, "menuItemCheckBox"
, "menuItemRadio"
, "menuListOption"
, "menuListPopup"
, "meter"
, "navigation"
, "note"
, "pane"
, "paragraph"
, "pdfActionableHighlight"
, "pdfRoot"
, "pluginObject"
, "popUpButton"
, "portal"
, "pre"
, "presentational"
, "progressIndicator"
, "radioButton"
, "radioGroup"
, "region"
, "rootWebArea"
, "row"
, "rowGroup"
, "rowHeader"
, "ruby"
, "rubyAnnotation"
, "scrollBar"
, "scrollView"
, "search"
, "searchBox"
, "section"
, "slider"
, "spinButton"
, "splitter"
, "staticText"
, "status"
, "strong"
, "suggestion"
, "svgRoot"
, "switch"
, "tab"
, "tabList"
, "tabPanel"
, "table"
, "tableHeaderContainer"
, "term"
, "textField"
, "textFieldWithComboBox"
, "time"
, "timer"
, "titleBar"
, "toggleButton"
, "toolbar"
, "tooltip"
, "tree"
, "treeGrid"
, "treeItem"
, "unknown"
, "video"
, "webView"
, or "window"
SortDirectionType
A sort applied to a table row or column header.
Enum
"unsorted"
, "ascending"
, "descending"
, or "other"
StateType
Describes characteristics of an AutomationNode
.
Enum
"autofillAvailable"
, "collapsed"
, "default"
, "editable"
, "expanded"
, "focusable"
, "focused"
, "horizontal"
, "hovered"
, "ignored"
, "invisible"
, "linked"
, "multiline"
, "multiselectable"
, "offscreen"
, "protected"
, "required"
, "richlyEditable"
, "vertical"
, or "visited"
TreeChangeObserverFilter
Possible tree changes to listen to using addTreeChangeObserver. Note that listening to all tree changes can be expensive.
Enum
"noTreeChanges"
, "liveRegionTreeChanges"
, "textMarkerChanges"
, or "allTreeChanges"
TreeChangeType
Possible changes to the automation tree. For any given atomic change to the tree, each node that's added, removed, or changed, will appear in exactly one TreeChange, with one of these types.
nodeCreated means that this node was added to the tree and its parent is new as well, so it's just one node in a new subtree that was added.
Enum
"nodeCreated"
, "subtreeCreated"
, "nodeChanged"
, "textChanged"
, "nodeRemoved"
, or "subtreeUpdateEnd"
Methods
addTreeChangeObserver
chrome.automation.addTreeChangeObserver(filter: TreeChangeObserverFilter, observer: function)
Add a tree change observer. Tree change observers are static/global, they listen to changes across all trees. Pass a filter to determine what specific tree changes to listen to, and note that listnening to all tree changes can be expensive.
Parameters
- filter
- observerfunction
A listener for changes on the
AutomationNode
tree.The observer function looks like this:
observer(treeChange: TreeChange) => {...}
- treeChange
getAccessibilityFocus
chrome.automation.getAccessibilityFocus(callback: function)
Get the automation node that currently has accessibility focus, globally. Will return null if none of the nodes in any loaded trees have accessibility focus.
Parameters
- callbackfunction
Called with the
AutomationNode
that currently has accessibility focus.The callback parameter should be a function that looks like this:
(focusedNode: AutomationNode) => {...}
- focusedNode
getDesktop
chrome.automation.getDesktop(callback: function)
Get the automation tree for the whole desktop which consists of all on screen views. Note this API is currently only supported on Chrome OS.
Parameters
- callbackfunction
Called when the
AutomationNode
for the page is available.The callback parameter should be a function that looks like this:
(rootNode: AutomationNode) => {...}
- rootNode
getFocus
chrome.automation.getFocus(callback: function)
Get the automation node that currently has focus, globally. Will return null if none of the nodes in any loaded trees have focus.
Parameters
- callbackfunction
Called with the
AutomationNode
that currently has focus.The callback parameter should be a function that looks like this:
(focusedNode: AutomationNode) => {...}
- focusedNode
getTree
chrome.automation.getTree(tabId: number, callback: function)
Get the automation tree for the tab with the given tabId, or the current tab if no tabID is given, enabling automation if necessary. Returns a tree with a placeholder root node; listen for the "loadComplete" event to get a notification that the tree has fully loaded (the previous root node reference will stop working at or before this point).
Parameters
- tabIdnumber
- callbackfunction
Called when the
AutomationNode
for the page is available.The callback parameter should be a function that looks like this:
(rootNode: AutomationNode) => {...}
- rootNode
removeTreeChangeObserver
chrome.automation.removeTreeChangeObserver(observer: function)
Remove a tree change observer.
Parameters
- observerfunction
A listener for changes on the
AutomationNode
tree.The observer function looks like this:
observer(treeChange: TreeChange) => {...}
- treeChange
setDocumentSelection
chrome.automation.setDocumentSelection(params: SetDocumentSelectionParams)
Sets the selection in a tree. This creates a selection in a single tree (anchorObject and focusObject must have the same root). Everything in the tree between the two node/offset pairs gets included in the selection. The anchor is where the user started the selection, while the focus is the point at which the selection gets extended e.g. when dragging with a mouse or using the keyboard. For nodes with the role staticText, the offset gives the character offset within the value where the selection starts or ends, respectively.