欢迎 What's new in Chrome extensions Get help with Chrome extensions API reference Samples
欢迎 What's new in Chrome extensions Get help with Chrome extensions 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.

  • Manifest Keys

    The following keys must be declared in the manifest to use this API.

    automation
  • Availability
    Dev channel Foreground only

Summary

Types

ActionType

All possible actions that can be performed on automation nodes.

Type

"annotatePageImages"

,

"blur"

,

"clearAccessibilityFocus"

,

"collapse"

,

"customAction"

,

"decrement"

,

"doDefault"

,

"expand"

,

"focus"

,

"getImageData"

,

"getTextLocation"

,

"hideTooltip"

,

"hitTest"

,

"increment"

,

"internalInvalidateTree"

,

"loadInlineTextBoxes"

,

"longClick"

,

"replaceSelectedText"

,

"resumeMedia"

,

"scrollBackward"

,

"scrollDown"

,

"scrollForward"

,

"scrollLeft"

,

"scrollRight"

,

"scrollUp"

,

"scrollToMakeVisible"

,

"scrollToPoint"

,

"scrollToPositionAtRowColumn"

,

"setAccessibilityFocus"

,

"setScrollOffset"

,

"setSelection"

,

"setSequentialFocusNavigationStartingPoint"

,

"setValue"

,

"showContextMenu"

,

"signalEndOfTest"

,

"showTooltip"

,

"startDuckingMedia"

,

"stopDuckingMedia"

,
or

"suspendMedia"

AriaCurrentState

Indicates the ARIA-current state.

Type

"false"

,

"true"

,

"page"

,

"step"

,

"location"

,

"date"

,
or

"time"

AutomationEvent

Properties

AutomationIntent

Properties

AutomationNode

Properties

  • accessKey

    string optional

    The key that activates this widget.

  • activeDescendant

    AutomationNode optional

    The node referred to by aria-activedescendant, where applicable

  • activeDescendantFor

    AutomationNode[] optional

    Reverse relationship for active descendant.

  • anchorAffinity

    string optional

    The affinity of the tree selection anchor, if any.

  • anchorObject

    AutomationNode optional

    The anchor node of the tree selection, if any.

  • anchorOffset

    number optional

    The anchor offset of the tree selection, if any.

  • appId

    string optional

    The application id for a tree rooted at this node.

  • ariaColumnCount

    number optional

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

  • ariaCurrentState

    Indicates aria-current state.

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

  • busy

    boolean optional

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

  • caretBounds

    Rect optional

    The current caret bounds in screen coordinates.

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

  • clickable

    boolean

    Explicitly set to true when this node is clickable.

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

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

  • doDefaultLabel

    string optional

    Explains what will happen when the doDefault action is performed.

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

  • errorMessage

    AutomationNode optional

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

  • errorMessageFor

    AutomationNode[] optional

    Reverse relationship for errorMessage.

  • firstChild

    AutomationNode optional

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

  • focusAffinity

    string optional

    The affinity of the tree selection focus, if any.

  • focusObject

    AutomationNode optional

    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.

  • hasPopup

    HasPopup optional

    Indicates the availability and type of an interactive popup element.

  • hierarchicalLevel

    number optional

    The level of a heading or tree item.

  • 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

    AutomationNode optional

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

  • invalidState

    InvalidState optional

    Indicates invalid-state.

  • isButton

    boolean

    Whether or not this node is a button.

  • isCheckBox

    boolean

    Whether or not this node is a checkbox.

  • isComboBox

    boolean

    Whether or not this node is a combobox.

  • isImage

    boolean

    Whether or not this node is an image.

  • 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 automation.AutomationNode.name attribute.

  • language

    string optional

    The author-provided language code for this subtree.

  • lastChild

    AutomationNode optional

  • 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

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

  • longClickLabel

    string optional

    Explains what will happen when the long click action is performed.

  • markers

    Marker[] optional

    An array of Marker objects for this node.

  • 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

    AutomationNode optional

  • nextOnLine

    AutomationNode optional

  • nextSibling

    AutomationNode optional

  • nextWindowFocus

    AutomationNode optional

  • nonAtomicTextFieldRoot

    boolean

    Indicates whether the object functions as a text field which exposes its descendants. Use cases include the root of a content-editable region, an ARIA textbox which isn't currently editable and which has interactive descendants, and a element that has "design-mode" set to "on".

  • 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

    AutomationNode optional

  • 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

    AutomationNode optional

  • previousOnLine

    AutomationNode optional

  • previousSibling

    AutomationNode optional

  • previousWindowFocus

    AutomationNode optional

  • 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

  • role

    RoleType optional

    The role of this node.

  • roleDescription

    string optional

    The role description for this node.

  • root

    AutomationNode optional

    The root node of the tree containing this AutomationNode.

  • 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

    AutomationNode optional

    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

    AutomationNode optional

    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,

    Hello world.

    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.

  • setSize

    number optional

    The number of items in a set;

  • sortDirection

    The sort direction of this node.

  • standardActions

    ActionType[] optional

    An array of standard actions available on this node.

  • state

    object optional

    The automation.StateTypes describing this node.

  • subscript

    boolean

    Indicates node text is subscript.

  • superscript

    boolean

    Indicates node text is superscript.

  • 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

    AutomationNode optional

    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

    AutomationNode optional

    The corresponding row header for this cell.

  • tableRowIndex

    number optional

    The row index of this row node.

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

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

  • addEventListener

    function

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

    The addEventListener function looks like: (eventType: EventType, listener: function, capture: boolean) => {...}

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

    • startIndex

      number

    • endIndex

      number

    • callback

      function

      The callback parameter looks like: (bounds: Rect) => void

  • createPosition

    function

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

    The createPosition function looks like: (type: PositionType, offset: number, isUpstream?: boolean) => {...}

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

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

  • find

    function

    Finds the first AutomationNode in this node's subtree which matches the given search parameters.

    The find function looks like: (params: FindParams) => {...}

  • findAll

    function

    Finds all the AutomationNodes in this node's subtree which matches the given search parameters.

    The findAll function looks like: (params: FindParams) => {...}

  • focus

    function

    Places focus on this node.

    The focus function looks like: () => {...}

  • 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: (maxWidth: number, maxHeight: number) => {...}

    • maxWidth

      number

    • maxHeight

      number

  • getNextTextMatch

    function

    The getNextTextMatch function looks like: (searchStr: string, backward: boolean) => {...}

    • searchStr

      string

    • backward

      boolean

  • hitTest

    function

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

    The hitTest function looks like: (x: number, y: number, eventToFire: EventType) => {...}

  • hitTestWithReply

    function

    Does a automation.AutomationNode.hitTest, and receives a callback with the resulting hit node.

    The hitTestWithReply function looks like: (x: number, y: number, callback: function) => {...}

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

    • attribute

      string

  • longClick

    function

    Simulates long click on node.

    The longClick function looks like: () => {...}

  • makeVisible

    function

    Scrolls this node to make it visible.

    The makeVisible function looks like: () => {...}

  • matches

    function

    Returns whether this node matches the given automation.FindParams.

    The matches function looks like: (params: FindParams) => {...}

    • returns

      boolean

  • performCustomAction

    function

    Performs custom action.

    The performCustomAction function looks like: (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: (actionType: ActionType) => {...}

  • removeEventListener

    function

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

    The removeEventListener function looks like: (eventType: EventType, listener: function, capture: boolean) => {...}

  • replaceSelectedText

    function

    Replaces the selected text within a text field.

    The replaceSelectedText function looks like: (value: string) => {...}

    • value

      string

  • resumeMedia

    function

    Resume playing any media within this tree.

    The resumeMedia function looks like: () => {...}

  • scrollBackward

    function

    Scrolls this scrollable container backward.

    The scrollBackward function looks like: (callback?: function) => {...}

    • callback

      function optional

      The callback parameter looks like: (result: boolean) => void

      • result

        boolean

  • scrollDown

    function

    Scrolls this scrollable container down.

    The scrollDown function looks like: (callback?: function) => {...}

    • callback

      function optional

      The callback parameter looks like: (result: boolean) => void

      • result

        boolean

  • scrollForward

    function

    Scrolls this scrollable container forward.

    The scrollForward function looks like: (callback?: function) => {...}

    • callback

      function optional

      The callback parameter looks like: (result: boolean) => void

      • result

        boolean

  • scrollLeft

    function

    Scrolls this scrollable container left.

    The scrollLeft function looks like: (callback?: function) => {...}

    • callback

      function optional

      The callback parameter looks like: (result: boolean) => void

      • result

        boolean

  • scrollRight

    function

    Scrolls this scrollable container right.

    The scrollRight function looks like: (callback?: function) => {...}

    • callback

      function optional

      The callback parameter looks like: (result: boolean) => void

      • result

        boolean

  • scrollToPoint

    function

    Scrolls this scrollable container to the given point.

    The scrollToPoint function looks like: (x: number, y: number) => {...}

    • x

      number

    • y

      number

  • scrollUp

    function

    Scrolls this scrollable container up.

    The scrollUp function looks like: (callback?: function) => {...}

    • callback

      function optional

      The callback parameter looks like: (result: boolean) => void

      • result

        boolean

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

  • setScrollOffset

    function

    Sets this scrollable container's scroll offset.

    The setScrollOffset function looks like: (x: number, y: number) => {...}

    • x

      number

    • y

      number

  • setSelection

    function

    Sets selection within a text field.

    The setSelection function looks like: (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: () => {...}

  • setValue

    function

    Sets the value of a text field.

    The setValue function looks like: (value: string) => {...}

    • value

      string

  • showContextMenu

    function

    Show the context menu for this element, as if the user right-clicked.

    The showContextMenu function looks like: () => {...}

  • startDuckingMedia

    function

    Start ducking any media within this tree.

    The startDuckingMedia function looks like: () => {...}

  • stopDuckingMedia

    function

    Stop ducking any media within this tree.

    The stopDuckingMedia function looks like: () => {...}

  • suspendMedia

    function

    Suspend any media playing within this tree.

    The suspendMedia function looks like: () => {...}

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

    • startIndex

      number

    • endIndex

      number

    • callback

      function

      The callback parameter looks like: (bounds: Rect) => void

AutomationPosition

Properties

  • affinity

    string

  • childIndex

    number

  • node

    AutomationNode optional

  • textOffset

    number

  • asLeafTextPosition

    function

    The asLeafTextPosition function looks like: () => {...}

  • asTextPosition

    function

    The asTextPosition function looks like: () => {...}

  • asTreePosition

    function

    The asTreePosition function looks like: () => {...}

  • atEndOfAnchor

    function

    The atEndOfAnchor function looks like: () => {...}

    • returns

      boolean

  • atEndOfDocument

    function

    The atEndOfDocument function looks like: () => {...}

    • returns

      boolean

  • atEndOfFormat

    function

    The atEndOfFormat function looks like: () => {...}

    • returns

      boolean

  • atEndOfLine

    function

    The atEndOfLine function looks like: () => {...}

    • returns

      boolean

  • atEndOfPage

    function

    The atEndOfPage function looks like: () => {...}

    • returns

      boolean

  • atEndOfParagraph

    function

    The atEndOfParagraph function looks like: () => {...}

    • returns

      boolean

  • atEndOfWord

    function

    The atEndOfWord function looks like: () => {...}

    • returns

      boolean

  • atStartOfAnchor

    function

    The atStartOfAnchor function looks like: () => {...}

    • returns

      boolean

  • atStartOfDocument

    function

    The atStartOfDocument function looks like: () => {...}

    • returns

      boolean

  • atStartOfFormat

    function

    The atStartOfFormat function looks like: () => {...}

    • returns

      boolean

  • atStartOfLine

    function

    The atStartOfLine function looks like: () => {...}

    • returns

      boolean

  • atStartOfPage

    function

    The atStartOfPage function looks like: () => {...}

    • returns

      boolean

  • atStartOfParagraph

    function

    The atStartOfParagraph function looks like: () => {...}

    • returns

      boolean

  • atStartOfWord

    function

    The atStartOfWord function looks like: () => {...}

    • returns

      boolean

  • getText

    function

    The getText function looks like: () => {...}

    • returns

      string

  • isInLineBreak

    function

    The isInLineBreak function looks like: () => {...}

    • returns

      boolean

  • isInTextObject

    function

    The isInTextObject function looks like: () => {...}

    • returns

      boolean

  • isInWhiteSpace

    function

    The isInWhiteSpace function looks like: () => {...}

    • returns

      boolean

  • isLeafTextPosition

    function

    The isLeafTextPosition function looks like: () => {...}

    • returns

      boolean

  • isNullPosition

    function

    The isNullPosition function looks like: () => {...}

    • returns

      boolean

  • isTextPosition

    function

    The isTextPosition function looks like: () => {...}

    • returns

      boolean

  • isTreePosition

    function

    The isTreePosition function looks like: () => {...}

    • returns

      boolean

  • isValid

    function

    The isValid function looks like: () => {...}

    • returns

      boolean

  • maxTextOffset

    function

    The maxTextOffset function looks like: () => {...}

    • returns

      number

  • moveToNextAnchorPosition

    function

    The moveToNextAnchorPosition function looks like: () => {...}

  • moveToNextCharacterPosition

    function

    The moveToNextCharacterPosition function looks like: () => {...}

  • moveToNextFormatEndPosition

    function

    The moveToNextFormatEndPosition function looks like: () => {...}

  • moveToNextFormatStartPosition

    function

    The moveToNextFormatStartPosition function looks like: () => {...}

  • moveToNextLeafTextPosition

    function

    The moveToNextLeafTextPosition function looks like: () => {...}

  • moveToNextLeafTreePosition

    function

    The moveToNextLeafTreePosition function looks like: () => {...}

  • moveToNextLineEndPosition

    function

    The moveToNextLineEndPosition function looks like: () => {...}

  • moveToNextLineStartPosition

    function

    The moveToNextLineStartPosition function looks like: () => {...}

  • moveToNextPageEndPosition

    function

    The moveToNextPageEndPosition function looks like: () => {...}

  • moveToNextPageStartPosition

    function

    The moveToNextPageStartPosition function looks like: () => {...}

  • moveToNextParagraphEndPosition

    function

    The moveToNextParagraphEndPosition function looks like: () => {...}

  • moveToNextParagraphStartPosition

    function

    The moveToNextParagraphStartPosition function looks like: () => {...}

  • moveToNextWordEndPosition

    function

    The moveToNextWordEndPosition function looks like: () => {...}

  • moveToNextWordStartPosition

    function

    The moveToNextWordStartPosition function looks like: () => {...}

  • moveToParentPosition

    function

    The moveToParentPosition function looks like: () => {...}

  • moveToPositionAtEndOfAnchor

    function

    The moveToPositionAtEndOfAnchor function looks like: () => {...}

  • moveToPositionAtEndOfDocument

    function

    The moveToPositionAtEndOfDocument function looks like: () => {...}

  • moveToPositionAtStartOfAnchor

    function

    The moveToPositionAtStartOfAnchor function looks like: () => {...}

  • moveToPositionAtStartOfDocument

    function

    The moveToPositionAtStartOfDocument function looks like: () => {...}

  • moveToPreviousAnchorPosition

    function

    The moveToPreviousAnchorPosition function looks like: () => {...}

  • moveToPreviousCharacterPosition

    function

    The moveToPreviousCharacterPosition function looks like: () => {...}

  • moveToPreviousFormatEndPosition

    function

    The moveToPreviousFormatEndPosition function looks like: () => {...}

  • moveToPreviousFormatStartPosition

    function

    The moveToPreviousFormatStartPosition function looks like: () => {...}

  • moveToPreviousLeafTextPosition

    function

    The moveToPreviousLeafTextPosition function looks like: () => {...}

  • moveToPreviousLeafTreePosition

    function

    The moveToPreviousLeafTreePosition function looks like: () => {...}

  • moveToPreviousLineEndPosition

    function

    The moveToPreviousLineEndPosition function looks like: () => {...}

  • moveToPreviousLineStartPosition

    function

    The moveToPreviousLineStartPosition function looks like: () => {...}

  • moveToPreviousPageEndPosition

    function

    The moveToPreviousPageEndPosition function looks like: () => {...}

  • moveToPreviousPageStartPosition

    function

    The moveToPreviousPageStartPosition function looks like: () => {...}

  • moveToPreviousParagraphEndPosition

    function

    The moveToPreviousParagraphEndPosition function looks like: () => {...}

  • moveToPreviousParagraphStartPosition

    function

    The moveToPreviousParagraphStartPosition function looks like: () => {...}

  • moveToPreviousWordEndPosition

    function

    The moveToPreviousWordEndPosition function looks like: () => {...}

  • moveToPreviousWordStartPosition

    function

    The moveToPreviousWordStartPosition function looks like: () => {...}

CustomAction

Properties

  • description

    string

  • id

    number

DefaultActionVerb

Describes possible actions when performing a do default action.

Type

"activate"

,

"check"

,

"click"

,

"clickAncestor"

,

"jump"

,

"open"

,

"press"

,

"select"

,
or

"uncheck"

DescriptionFromType

Type

"ariaDescription"

,

"attributeExplicitlyEmpty"

,

"buttonLabel"

,

"popoverAttribute"

,

"relatedElement"

,

"rubyAnnotation"

,

"summary"

,

"svgDescElement"

,

"tableCaption"

,
or

"title"

EventType

Possible events fired on an automation.AutomationNode.

Type

"accessKeyChanged"

,

"activeDescendantChanged"

,

"alert"

,

"ariaAttributeChanged"

,

"ariaCurrentChanged"

,

"atomicChanged"

,

"autoCompleteChanged"

,

"autocorrectionOccured"

,

"autofillAvailabilityChanged"

,

"blur"

,

"busyChanged"

,

"caretBoundsChanged"

,

"checkedStateChanged"

,

"checkedStateDescriptionChanged"

,

"childrenChanged"

,

"classNameChanged"

,

"clicked"

,

"collapsed"

,

"controlsChanged"

,

"detailsChanged"

,

"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"

,

"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"

,

"selectionRemove"

,

"setSizeChanged"

,

"show"

,

"sortChanged"

,

"stateChanged"

,

"subtreeCreated"

,

"textAttributeChanged"

,

"textSelectionChanged"

,

"textChanged"

,

"tooltipClosed"

,

"tooltipOpened"

,

"treeChanged"

,

"valueInTextFieldChanged"

,

"valueChanged"

,

"windowActivated"

,

"windowDeactivated"

,
or

"windowVisibilityChanged"

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

HasPopup

Availability and types for an interactive popup element.

Type

"false"

,

"true"

,

"menu"

,

"listbox"

,

"tree"

,

"grid"

,
or

"dialog"

IntentCommandType

A command associated with an automation.AutomationIntent.

Type

"clearSelection"

,

"delete"

,

"dictate"

,

"extendSelection"

,

"format"

,

"history"

,

"insert"

,

"marker"

,

"moveSelection"

,
or

"setSelection"

IntentInputEventType

The type of an input event associated with an automation.AutomationIntent. It describes an edit command, e.g. IntentCommandType.insert, in more detail.

Type

"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 automation.AutomationIntent.

Type

"backward"

, or

"forward"

IntentTextBoundaryType

A text boundary associated with an automation.AutomationIntent.

Type

"character"

,

"formatEnd"

,

"formatStart"

,

"formatStartOrEnd"

,

"lineEnd"

,

"lineStart"

,

"lineStartOrEnd"

,

"object"

,

"pageEnd"

,

"pageStart"

,

"pageStartOrEnd"

,

"paragraphEnd"

,

"paragraphStart"

,

"paragraphStartSkippingEmptyParagraphs"

,

"paragraphStartOrEnd"

,

"sentenceEnd"

,

"sentenceStart"

,

"sentenceStartOrEnd"

,

"webPage"

,

"wordEnd"

,

"wordStart"

,
or

"wordStartOrEnd"

InvalidState

Lists the values that invalidState can take on.

Type

"false"

, or

"true"

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.

MarkerType

Types of markers on text. See AutomationNode.markerTypes.

Type

"spelling"

,

"grammar"

,

"textMatch"

,

"activeSuggestion"

,

"suggestion"

,
or

"highlight"

NameFromType

Where the node's name is from.

Type

"attribute"

,

"attributeExplicitlyEmpty"

,

"caption"

,

"contents"

,

"placeholder"

,

"popoverAttribute"

,

"relatedElement"

,

"title"

,
or

"value"

PositionType

A type of AutomationPosition.

Type

"null"

,

"text"

,
or

"tree"

Rect

Properties

  • height

    number

  • left

    number

  • top

    number

  • width

    number

Restriction

The input restriction for a object -- even non-controls can be disabled.

Type

"disabled"

, or

"readOnly"

RoleType

Describes the purpose of an automation.AutomationNode.

Type

"abbr"

,

"alert"

,

"alertDialog"

,

"application"

,

"article"

,

"audio"

,

"banner"

,

"blockquote"

,

"button"

,

"canvas"

,

"caption"

,

"caret"

,

"cell"

,

"checkBox"

,

"client"

,

"code"

,

"colorWell"

,

"column"

,

"columnHeader"

,

"comboBoxGrouping"

,

"comboBoxMenuButton"

,

"comboBoxSelect"

,

"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"

,

"image"

,

"imeCandidate"

,

"inlineTextBox"

,

"inputTime"

,

"keyboard"

,

"labelText"

,

"layoutTable"

,

"layoutTableCell"

,

"layoutTableRow"

,

"legend"

,

"lineBreak"

,

"link"

,

"list"

,

"listBox"

,

"listBoxOption"

,

"listGrid"

,

"listItem"

,

"listMarker"

,

"log"

,

"main"

,

"mark"

,

"marquee"

,

"math"

,

"mathMLFraction"

,

"mathMLIdentifier"

,

"mathMLMath"

,

"mathMLMultiscripts"

,

"mathMLNoneScript"

,

"mathMLNumber"

,

"mathMLOperator"

,

"mathMLOver"

,

"mathMLPrescriptDelimiter"

,

"mathMLRoot"

,

"mathMLRow"

,

"mathMLSquareRoot"

,

"mathMLStringLiteral"

,

"mathMLSub"

,

"mathMLSubSup"

,

"mathMLSup"

,

"mathMLTable"

,

"mathMLTableCell"

,

"mathMLTableRow"

,

"mathMLText"

,

"mathMLUnder"

,

"mathMLUnderOver"

,

"menu"

,

"menuBar"

,

"menuItem"

,

"menuItemCheckBox"

,

"menuItemRadio"

,

"menuListOption"

,

"menuListPopup"

,

"meter"

,

"navigation"

,

"note"

,

"pane"

,

"paragraph"

,

"pdfActionableHighlight"

,

"pdfRoot"

,

"pluginObject"

,

"popUpButton"

,

"portal"

,

"pre"

,

"progressIndicator"

,

"radioButton"

,

"radioGroup"

,

"region"

,

"rootWebArea"

,

"row"

,

"rowGroup"

,

"rowHeader"

,

"ruby"

,

"rubyAnnotation"

,

"scrollBar"

,

"scrollView"

,

"search"

,

"searchBox"

,

"section"

,

"slider"

,

"spinButton"

,

"splitter"

,

"staticText"

,

"status"

,

"strong"

,

"subscript"

,

"suggestion"

,

"superscript"

,

"svgRoot"

,

"switch"

,

"tab"

,

"tabList"

,

"tabPanel"

,

"table"

,

"tableHeaderContainer"

,

"term"

,

"textField"

,

"textFieldWithComboBox"

,

"time"

,

"timer"

,

"titleBar"

,

"toggleButton"

,

"toolbar"

,

"tooltip"

,

"tree"

,

"treeGrid"

,

"treeItem"

,

"unknown"

,

"video"

,

"webView"

,
or

"window"

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.

SortDirectionType

A sort applied to a table row or column header.

Type

"unsorted"

,

"ascending"

,

"descending"

,
or

"other"

StateType

Describes characteristics of an automation.AutomationNode.

Type

"autofillAvailable"

,

"collapsed"

,

"default"

,

"editable"

,

"expanded"

,

"focusable"

,

"focused"

,

"horizontal"

,

"hovered"

,

"ignored"

,

"invisible"

,

"linked"

,

"multiline"

,

"multiselectable"

,

"offscreen"

,

"protected"

,

"required"

,

"richlyEditable"

,

"vertical"

,
or

"visited"

TreeChange

Properties

TreeChangeObserverFilter

Possible tree changes to listen to using addTreeChangeObserver. Note that listening to all tree changes can be expensive.

Type

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

Type

"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

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

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

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

removeTreeChangeObserver

chrome.automation.removeTreeChangeObserver(
  observer: function,
)

Remove a tree change observer.

Parameters

  • observer

    function

    The observer parameter looks like: (treeChange: TreeChange) => void

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.