Welcome Getting started API Reference Samples
Welcome Getting started API Reference Samples

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.

  • Availability
    Dev channel only.

Summary

Types

AutomationEvent

Properties

  • eventFrom
    string

    The source of this event.

  • A list of AutomationIntents associated with this event.

  • mouseX
    number

    Any mouse coordinates associated with this event.

  • mouseY
    number
  • stopPropagation
    function

    Stops this event from further processing except for any remaining listeners on AutomationEvent.target.

    The stopPropagation function looks like this:

    stopPropagation() => {...}
  • The AutomationNode to which the event was targeted.

  • The type of the event.

AutomationIntent

Properties

AutomationNode

Properties

  • accessKey
    string optional

    The key that activates this widget.

  • activeDescendant

    The node referred to by aria-activedescendant, where applicable

  • activeDescendantFor
    AutomationNode[] optional

    Reverse relationship for active descendant.

  • addEventListener
    function

    Adds a listener for the given event type and event phase.

    The addEventListener function looks like this:

    addEventListener(eventType: EventType, listener: function, capture: boolean) => {...}
  • anchorAffinity
    string optional

    The affinity of the tree selection anchor, if any.

  • anchorObject

    The anchor node of the tree selection, if any.

  • anchorOffset
    number optional

    The anchor offset of the tree selection, if any.

  • ariaColumnCount
    number optional

    The number of columns in this table as specified by the page author.

  • ariaInvalidValue
    string optional

    The value of the aria-invalid attribute, indicating the error type.

  • ariaRowCount
    number optional

    The number of rows in this table as specified by the page author.

  • autoComplete
    string optional

    Aria auto complete.

  • backgroundColor
    number optional

    The RGBA background color of this subtree, as an integer.

  • bold
    boolean

    Indicates node text is bold.

  • boundsForRange
    function

    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) => {...}
    • startIndex
      number
    • endIndex
      number
    • callback
      function

      The callback parameter should be a function that looks like this:

      (bounds: Rect) => {...}
  • busy
    boolean optional

    The value of aria-busy for a live region or any other element.

  • checked
    string optional

    Tri-state describing checkbox or radio button: 'false' | 'true' | 'mixed'

  • checkedStateDescription
    string optional

    Description of the state of the checkbox. Used only when the node is checkable.

  • children

    Walking the tree.

  • className
    string optional

    The name of the programmatic backing object.

  • color
    number optional

    The RGBA foreground color of this subtree, as an integer.

  • colorValue
    number optional

    The RGBA color of an input element whose value is a color.

  • containerLiveAtomic
    boolean optional

    The value of aria-atomic if this node is inside a live region.

  • containerLiveBusy
    boolean optional

    The value of aria-busy if this node is inside a live region.

  • containerLiveRelevant
    string optional

    The value of aria-relevant if this node is inside a live region.

  • containerLiveStatus
    string optional

    The type of live region if this node is inside a live region.

  • controlledBy
    AutomationNode[] optional

    Reverse relationship for controls.

  • controls
    AutomationNode[] optional

    The nodes, if any, which this node is specified to control via aria-controls.

  • createPosition
    function

    Creates a position object backed by Chrome's accessibility position support.

    The createPosition function looks like this:

    createPosition(offset: number, isUpstream: boolean): AutomationPosition => {...}
  • customActions
    CustomAction[] optional

    An array of custom actions.

  • defaultActionVerb

    The action taken by calling doDefault.

  • describedBy
    AutomationNode[] optional

    The nodes, if any, which form a description for this node.

  • description
    string optional

    The purpose of the node, other than the role, if any.

  • descriptionFor
    AutomationNode[] optional

    Reverse relationship for describedBy.

  • details
    AutomationNode[] optional

    A node that provides more details about the current node.

  • detailsFor
    AutomationNode[] optional

    Reverse relationship for details.

  • detectedLanguage
    string optional

    The detected language code for this subtree.

  • display
    string optional

    The CSS display attribute for this node, if applicable.

  • doDefault
    function

    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() => {...}
  • docLoaded
    boolean optional

    Whether this document has finished loading.

  • docLoadingProgress
    number optional

    The proportion (out of 1.0) that this doc has completed loading.

  • docTitle
    string optional

    The title of this document.

  • docUrl
    string optional

    The URL of this document.

  • domQuerySelector
    function

    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) => {...}
    • selector
      string
    • callback
      function

      The callback parameter should be a function that looks like this:

      (node: AutomationNode) => {...}
  • editableRoot
    boolean

    Indicates whether this is a root of an editable subtree.

  • errorMessage

    A node that provides an error message for a current node.

  • errorMessageFor
    AutomationNode[] optional

    Reverse relationship for errorMessage.

  • find
    function

    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 => {...}
  • findAll
    function

    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[] => {...}
  • firstChild
  • flowFrom
    AutomationNode[] optional

    Reverse relationship for flowTo.

  • flowTo
    AutomationNode[] optional

    The nodes, if any, which may optionally be navigated to after this one. See aria-flowto.

  • focus
    function

    Places focus on this node.

    The focus function looks like this:

    focus() => {...}
  • focusAffinity
    string optional

    The affinity of the tree selection focus, if any.

  • focusObject

    The focus node of the tree selection, if any.

  • focusOffset
    number optional

    The focus offset of the tree selection, if any.

  • fontFamily
    string

    Indicates the font family.

  • fontSize
    number optional

    Indicates the font size of this node.

  • getImageData
    function

    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) => {...}
    • maxWidth
      number
    • maxHeight
      number
  • getNextTextMatch
    function

    The getNextTextMatch function looks like this:

    getNextTextMatch(searchStr: string, backward: boolean): AutomationNode => {...}
  • hasPopup
    string 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

  • hierarchicalLevel
    number optional

    The level of a heading or tree item.

  • hitTest
    function

    Does a hit test of the given global screen coordinates, and fires eventToFire on the resulting object.

    The hitTest function looks like this:

    hitTest(x: number, y: number, eventToFire: EventType) => {...}
  • hitTestWithReply
    function

    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) => {...}
    • x
      number
    • y
      number
    • callback
      function

      The callback parameter should be a function that looks like this:

      (node: AutomationNode) => {...}
  • htmlAttributes
    object optional

    A map containing all HTML attributes and their values

  • htmlTag
    string optional

    The HTML tag for this element, if this node is an HTML element.

  • imageAnnotation
    string 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.

  • imageDataUrl
    string optional

    A data url with the contents of this object's image or thumbnail.

  • inPageLinkTarget

    The target of an in-page link.

  • indexInParent
    number optional

    The index of this node in its parent node's list of children. If this is the root node, this will be undefined.

  • innerHtml
    string optional

    The inner html of this element. Only populated for math content.

  • inputType
    string optional

    The input type of a text field, such as "text" or "email".

  • isRootNode
    boolean

    Whether this AutomationNode is a root node.

  • isSelectionBackward
    boolean optional

    If a selection is present, whether the anchor of the selection comes after its focus in the accessibility tree.

  • italic
    boolean

    Indicates node text is italic.

  • labelFor
    AutomationNode[] optional

    Reverse relationship for labelledBy.

  • labelledBy
    AutomationNode[] 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.

  • language
    string optional

    The author-provided language code for this subtree.

  • languageAnnotationForStringAttribute
    function

    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[] => {...}
  • lastChild
  • lineThrough
    boolean

    Indicates node text is line through.

  • liveAtomic
    boolean optional

    The value of aria-atomic for a live region.

  • liveRelevant
    string optional

    The value of aria-relevant for a live region.

  • liveStatus
    string optional

    The type of region if this is the root of a live region. Possible values are 'polite' and 'assertive'.

  • location
    Rect optional

    The rendered location (as a bounding box) of this node in global screen coordinates.

  • makeVisible
    function

    Scrolls this node to make it visible.

    The makeVisible function looks like this:

    makeVisible() => {...}
  • markers
    Marker[] optional

    An array of Marker objects for this node.

  • matches
    function

    Returns whether this node matches the given FindParams.

    The matches function looks like this:

    matches(params: FindParams): boolean => {...}
  • maxValueForRange
    number optional

    The maximum possible value for this range.

  • minValueForRange
    number optional

    The minimum possible value for this range.

  • modal
    boolean optional

    Marks this subtree as modal.

  • name
    string optional

    The accessible name for this node, via the Accessible Name Calculation process.

  • nameFrom
    NameFromType optional

    The source of the name.

  • nextFocus
  • nextOnLine
  • nextSibling
  • nonInlineTextWordEnds
    number[] 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.

  • nonInlineTextWordStarts
    number[] 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.

  • notUserSelectableStyle
    boolean optional

    Indicates that the node is marked user-select:none

  • parent
  • performCustomAction
    function

    Performs custom action.

    The performCustomAction function looks like this:

    performCustomAction(customActionId: number) => {...}
    • customActionId
      number
  • performStandardAction
    function

    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) => {...}
  • placeholder
    string optional

    The placeholder for this text field, if any.

  • posInSet
    number optional

    The 1-based index of an item in a set.

  • previousFocus
  • previousOnLine
  • previousSibling
  • removeEventListener
    function

    Removes a listener for the given event type and event phase.

    The removeEventListener function looks like this:

    removeEventListener(eventType: EventType, listener: function, capture: boolean) => {...}
  • replaceSelectedText
    function

    Replaces the selected text within a text field.

    The replaceSelectedText function looks like this:

    replaceSelectedText(value: string) => {...}
    • value
      string
  • restriction
    string 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

  • resumeMedia
    function

    Resume playing any media within this tree.

    The resumeMedia function looks like this:

    resumeMedia() => {...}
  • role
    RoleType optional

    The role of this node.

  • roleDescription
    string optional

    The role description for this node.

  • root

    The root node of the tree containing this AutomationNode.

  • scrollBackward
    function

    Scrolls this scrollable container backward.

    The scrollBackward function looks like this:

    scrollBackward(callback: function) => {...}
    • callback
      function

      The callback parameter should be a function that looks like this:

      (result: boolean) => {...}
      • result
        boolean
  • scrollDown
    function

    Scrolls this scrollable container down.

    The scrollDown function looks like this:

    scrollDown(callback: function) => {...}
    • callback
      function

      The callback parameter should be a function that looks like this:

      (result: boolean) => {...}
      • result
        boolean
  • scrollForward
    function

    Scrolls this scrollable container forward.

    The scrollForward function looks like this:

    scrollForward(callback: function) => {...}
    • callback
      function

      The callback parameter should be a function that looks like this:

      (result: boolean) => {...}
      • result
        boolean
  • scrollLeft
    function

    Scrolls this scrollable container left.

    The scrollLeft function looks like this:

    scrollLeft(callback: function) => {...}
    • callback
      function

      The callback parameter should be a function that looks like this:

      (result: boolean) => {...}
      • result
        boolean
  • scrollRight
    function

    Scrolls this scrollable container right.

    The scrollRight function looks like this:

    scrollRight(callback: function) => {...}
    • callback
      function

      The callback parameter should be a function that looks like this:

      (result: boolean) => {...}
      • result
        boolean
  • scrollToPoint
    function

    Scrolls this scrollable container to the given point.

    The scrollToPoint function looks like this:

    scrollToPoint(x: number, y: number) => {...}
    • x
      number
    • y
      number
  • scrollUp
    function

    Scrolls this scrollable container up.

    The scrollUp function looks like this:

    scrollUp(callback: function) => {...}
    • callback
      function

      The callback parameter should be a function that looks like this:

      (result: boolean) => {...}
      • result
        boolean
  • scrollX
    number optional

    Scrollable container attributes.

  • scrollXMax
    number optional
  • scrollXMin
    number optional
  • scrollY
    number optional
  • scrollYMax
    number optional
  • scrollYMin
    number optional
  • scrollable
    boolean optional

    Indicates whether this node is scrollable.

  • selected
    boolean optional

    Indicates whether this node is selected, unselected, or neither.

  • selectionEndAffinity
    string optional

    The affinity of the tree selection end, if any.

  • selectionEndObject

    The selection end node of the tree selection, if any.

  • selectionEndOffset
    number optional

    The selection end offset of the tree selection, if any.

  • selectionStartAffinity
    string optional

    The affinity of the tree selection start, if any.

  • selectionStartObject

    The selection start node of the tree selection, if any.

  • selectionStartOffset
    number optional

    The selection start offset of the tree selection, if any.

  • sentenceEnds
    number[] 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.

  • sentenceStarts
    number[] optional

    The start indexes of each sentence within the node's name.

  • setAccessibilityFocus
    function

    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() => {...}
  • setScrollOffset
    function

    Sets this scrollable container's scroll offset.

    The setScrollOffset function looks like this:

    setScrollOffset(x: number, y: number) => {...}
    • x
      number
    • y
      number
  • setSelection
    function

    Sets selection within a text field.

    The setSelection function looks like this:

    setSelection(startIndex: number, endIndex: number) => {...}
    • startIndex
      number
    • endIndex
      number
  • setSequentialFocusNavigationStartingPoint
    function

    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() => {...}
  • setSize
    number optional

    The number of items in a set;

  • setValue
    function

    Sets the value of a text field.

    The setValue function looks like this:

    setValue(value: string) => {...}
    • value
      string
  • showContextMenu
    function

    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.

  • standardActions
    ActionType[] optional

    An array of standard actions available on this node.

  • startDuckingMedia
    function

    Start ducking any media within this tree.

    The startDuckingMedia function looks like this:

    startDuckingMedia() => {...}
  • state
    object optional

    The StateTypes describing this node.

  • stopDuckingMedia
    function

    Stop ducking any media within this tree.

    The stopDuckingMedia function looks like this:

    stopDuckingMedia() => {...}
  • subscript
    boolean

    Indicates node text is subscript.

  • superscript
    boolean

    Indicates node text is superscript.

  • suspendMedia
    function

    Suspend any media playing within this tree.

    The suspendMedia function looks like this:

    suspendMedia() => {...}
  • tableCellAriaColumnIndex
    number optional

    The ARIA column index as specified by the page author.

  • tableCellAriaRowIndex
    number optional

    The ARIA row index as specified by the page author.

  • tableCellColumnHeaders
    AutomationNode[] optional

    The column header nodes for a table cell.

  • tableCellColumnIndex
    number optional

    The zero-based index of the column that this cell is in as specified in the DOM.

  • tableCellColumnSpan
    number optional

    The number of columns that this cell spans (default is 1).

  • tableCellRowHeaders
    AutomationNode[] optional

    The row header nodes for a table cell.

  • tableCellRowIndex
    number optional

    The zero-based index of the row that this cell is in as specified in the DOM.

  • tableCellRowSpan
    number optional

    The number of rows that this cell spans (default is 1).

  • tableColumnCount
    number optional

    The number of columns in this table as specified in the DOM.

  • tableColumnHeader

    The corresponding column header for this cell.

  • tableColumnIndex
    number optional

    The column index of this column node.

  • tableRowCount
    number optional

    The number of rows in this table as specified in the DOM.

  • tableRowHeader

    The corresponding row header for this cell.

  • tableRowIndex
    number optional

    The row index of this row node.

  • textInputType
    string optional

    The input type, like email or number.

  • textSelEnd
    number optional

    The character index of the end of the selection within this editable text element; -1 if no selection.

  • textSelStart
    number optional

    The character index of the start of the selection within this editable text element; -1 if no selection.

  • tooltip
    string optional

    The tooltip of the node, if any.

  • unclippedBoundsForRange
    function

    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) => {...}
    • startIndex
      number
    • endIndex
      number
    • callback
      function

      The callback parameter should be a function that looks like this:

      (bounds: Rect) => {...}
  • unclippedLocation
    Rect optional

    The location (as a bounding box) of this node in global screen coordinates without applying any clipping from ancestors.

  • underline
    boolean

    Indicates node text is underline.

  • url
    string optional

    The URL that this link will navigate to.

  • value
    string optional

    The value for this node: for example the value attribute of an <input> element.

  • valueForRange
    number optional

    The current value for this range.

  • wordEnds
    number[] optional
  • wordStarts
    number[] optional

    The start and end index of each word in an inline text box.

AutomationPosition

Properties

  • affinity
    string
  • asLeafTextPosition
    function

    The asLeafTextPosition function looks like this:

    asLeafTextPosition() => {...}
  • asTextPosition
    function

    The asTextPosition function looks like this:

    asTextPosition() => {...}
  • asTreePosition
    function

    The asTreePosition function looks like this:

    asTreePosition() => {...}
  • atEndOfAnchor
    function

    The atEndOfAnchor function looks like this:

    atEndOfAnchor(): boolean => {...}
    • returns
      boolean
  • atEndOfDocument
    function

    The atEndOfDocument function looks like this:

    atEndOfDocument(): boolean => {...}
    • returns
      boolean
  • atEndOfFormat
    function

    The atEndOfFormat function looks like this:

    atEndOfFormat(): boolean => {...}
    • returns
      boolean
  • atEndOfLine
    function

    The atEndOfLine function looks like this:

    atEndOfLine(): boolean => {...}
    • returns
      boolean
  • atEndOfPage
    function

    The atEndOfPage function looks like this:

    atEndOfPage(): boolean => {...}
    • returns
      boolean
  • atEndOfParagraph
    function

    The atEndOfParagraph function looks like this:

    atEndOfParagraph(): boolean => {...}
    • returns
      boolean
  • atEndOfWord
    function

    The atEndOfWord function looks like this:

    atEndOfWord(): boolean => {...}
    • returns
      boolean
  • atStartOfAnchor
    function

    The atStartOfAnchor function looks like this:

    atStartOfAnchor(): boolean => {...}
    • returns
      boolean
  • atStartOfDocument
    function

    The atStartOfDocument function looks like this:

    atStartOfDocument(): boolean => {...}
    • returns
      boolean
  • atStartOfFormat
    function

    The atStartOfFormat function looks like this:

    atStartOfFormat(): boolean => {...}
    • returns
      boolean
  • atStartOfLine
    function

    The atStartOfLine function looks like this:

    atStartOfLine(): boolean => {...}
    • returns
      boolean
  • atStartOfPage
    function

    The atStartOfPage function looks like this:

    atStartOfPage(): boolean => {...}
    • returns
      boolean
  • atStartOfParagraph
    function

    The atStartOfParagraph function looks like this:

    atStartOfParagraph(): boolean => {...}
    • returns
      boolean
  • atStartOfWord
    function

    The atStartOfWord function looks like this:

    atStartOfWord(): boolean => {...}
    • returns
      boolean
  • childIndex
    number
  • getText
    function

    The getText function looks like this:

    getText(): string => {...}
    • returns
      string
  • isInLineBreak
    function

    The isInLineBreak function looks like this:

    isInLineBreak(): boolean => {...}
    • returns
      boolean
  • isInTextObject
    function

    The isInTextObject function looks like this:

    isInTextObject(): boolean => {...}
    • returns
      boolean
  • isInWhiteSpace
    function

    The isInWhiteSpace function looks like this:

    isInWhiteSpace(): boolean => {...}
    • returns
      boolean
  • isLeafTextPosition
    function

    The isLeafTextPosition function looks like this:

    isLeafTextPosition(): boolean => {...}
    • returns
      boolean
  • isNullPosition
    function

    The isNullPosition function looks like this:

    isNullPosition(): boolean => {...}
    • returns
      boolean
  • isTextPosition
    function

    The isTextPosition function looks like this:

    isTextPosition(): boolean => {...}
    • returns
      boolean
  • isTreePosition
    function

    The isTreePosition function looks like this:

    isTreePosition(): boolean => {...}
    • returns
      boolean
  • isValid
    function

    The isValid function looks like this:

    isValid(): boolean => {...}
    • returns
      boolean
  • maxTextOffset
    function

    The maxTextOffset function looks like this:

    maxTextOffset(): number => {...}
    • returns
      number
  • moveToNextAnchorPosition
    function

    The moveToNextAnchorPosition function looks like this:

    moveToNextAnchorPosition() => {...}
  • moveToNextCharacterPosition
    function

    The moveToNextCharacterPosition function looks like this:

    moveToNextCharacterPosition() => {...}
  • moveToNextFormatEndPosition
    function

    The moveToNextFormatEndPosition function looks like this:

    moveToNextFormatEndPosition() => {...}
  • moveToNextLeafTextPosition
    function

    The moveToNextLeafTextPosition function looks like this:

    moveToNextLeafTextPosition() => {...}
  • moveToNextLeafTreePosition
    function

    The moveToNextLeafTreePosition function looks like this:

    moveToNextLeafTreePosition() => {...}
  • moveToNextLineEndPosition
    function

    The moveToNextLineEndPosition function looks like this:

    moveToNextLineEndPosition() => {...}
  • moveToNextLineStartPosition
    function

    The moveToNextLineStartPosition function looks like this:

    moveToNextLineStartPosition() => {...}
  • moveToNextPageEndPosition
    function

    The moveToNextPageEndPosition function looks like this:

    moveToNextPageEndPosition() => {...}
  • moveToNextPageStartPosition
    function

    The moveToNextPageStartPosition function looks like this:

    moveToNextPageStartPosition() => {...}
  • moveToNextParagraphEndPosition
    function

    The moveToNextParagraphEndPosition function looks like this:

    moveToNextParagraphEndPosition() => {...}
  • moveToNextParagraphStartPosition
    function

    The moveToNextParagraphStartPosition function looks like this:

    moveToNextParagraphStartPosition() => {...}
  • moveToNextWordEndPosition
    function

    The moveToNextWordEndPosition function looks like this:

    moveToNextWordEndPosition() => {...}
  • moveToNextWordStartPosition
    function

    The moveToNextWordStartPosition function looks like this:

    moveToNextWordStartPosition() => {...}
  • moveToParentPosition
    function

    The moveToParentPosition function looks like this:

    moveToParentPosition() => {...}
  • moveToPositionAtEndOfAnchor
    function

    The moveToPositionAtEndOfAnchor function looks like this:

    moveToPositionAtEndOfAnchor() => {...}
  • moveToPositionAtEndOfDocument
    function

    The moveToPositionAtEndOfDocument function looks like this:

    moveToPositionAtEndOfDocument() => {...}
  • moveToPositionAtStartOfAnchor
    function

    The moveToPositionAtStartOfAnchor function looks like this:

    moveToPositionAtStartOfAnchor() => {...}
  • moveToPositionAtStartOfDocument
    function

    The moveToPositionAtStartOfDocument function looks like this:

    moveToPositionAtStartOfDocument() => {...}
  • moveToPreviousAnchorPosition
    function

    The moveToPreviousAnchorPosition function looks like this:

    moveToPreviousAnchorPosition() => {...}
  • moveToPreviousCharacterPosition
    function

    The moveToPreviousCharacterPosition function looks like this:

    moveToPreviousCharacterPosition() => {...}
  • moveToPreviousFormatStartPosition
    function

    The moveToPreviousFormatStartPosition function looks like this:

    moveToPreviousFormatStartPosition() => {...}
  • moveToPreviousLeafTextPosition
    function

    The moveToPreviousLeafTextPosition function looks like this:

    moveToPreviousLeafTextPosition() => {...}
  • moveToPreviousLeafTreePosition
    function

    The moveToPreviousLeafTreePosition function looks like this:

    moveToPreviousLeafTreePosition() => {...}
  • moveToPreviousLineEndPosition
    function

    The moveToPreviousLineEndPosition function looks like this:

    moveToPreviousLineEndPosition() => {...}
  • moveToPreviousLineStartPosition
    function

    The moveToPreviousLineStartPosition function looks like this:

    moveToPreviousLineStartPosition() => {...}
  • moveToPreviousPageEndPosition
    function

    The moveToPreviousPageEndPosition function looks like this:

    moveToPreviousPageEndPosition() => {...}
  • moveToPreviousPageStartPosition
    function

    The moveToPreviousPageStartPosition function looks like this:

    moveToPreviousPageStartPosition() => {...}
  • moveToPreviousParagraphEndPosition
    function

    The moveToPreviousParagraphEndPosition function looks like this:

    moveToPreviousParagraphEndPosition() => {...}
  • moveToPreviousParagraphStartPosition
    function

    The moveToPreviousParagraphStartPosition function looks like this:

    moveToPreviousParagraphStartPosition() => {...}
  • moveToPreviousWordEndPosition
    function

    The moveToPreviousWordEndPosition function looks like this:

    moveToPreviousWordEndPosition() => {...}
  • moveToPreviousWordStartPosition
    function

    The moveToPreviousWordStartPosition function looks like this:

    moveToPreviousWordStartPosition() => {...}
  • node
  • textOffset
    number

CustomAction

Properties

  • description
    string
  • id
    number

FindParams

Properties

  • attributes
    object 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

  • role
    RoleType optional
  • state
    object 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 if StateType.disabled was not present in the node's state object.

LanguageSpan

Properties

  • endIndex
    number

    Exclusive end index of substring that contains language.

  • language
    string

    Detected language for substring.

  • probability
    number

    Probability that language is correct.

  • startIndex
    number

    Inclusive start index of substring that contains language.

Marker

Properties

  • endOffset
    number

    The end offset within the text of the associated node.

  • flags
    object

    A mapping of MarkerType to true or undefined indicating the marker types for this marker.

  • startOffset
    number

    The start offset within the text of the associated node.

Rect

Properties

  • height
    number
  • left
    number
  • top
    number
  • width
    number

SetDocumentSelectionParams

Properties

  • anchorObject

    The node where the selection begins.

  • anchorOffset
    number

    The offset in the anchor node where the selection begins.

  • focusObject

    The node where the selection ends.

  • focusOffset
    number

    The offset within the focus node where the selection ends.

TreeChange

Properties

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

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

  • callback
    function

    Called with the AutomationNode that currently has accessibility focus.

    The callback parameter should be a function that looks like this:

    (focusedNode: AutomationNode) => {...}

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

  • callback
    function

    Called when the AutomationNode for the page is available.

    The callback parameter should be a function that looks like this:

    (rootNode: AutomationNode) => {...}

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

  • callback
    function

    Called with the AutomationNode that currently has focus.

    The callback parameter should be a function that looks like this:

    (focusedNode: AutomationNode) => {...}

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

  • tabId
    number
  • callback
    function

    Called when the AutomationNode for the page is available.

    The callback parameter should be a function that looks like this:

    (rootNode: AutomationNode) => {...}

removeTreeChangeObserver

chrome.automation.removeTreeChangeObserver(observer: function)

Remove a tree change observer.

Parameters

  • observer
    function

    A listener for changes on the AutomationNode tree.

    The observer function looks like this:

    observer(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.

We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.