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.
Learn more.
|
Manifest: |
"automation": {...}
|
Summary
Types | |
---|---|
EventType | |
RoleType | |
StateType | |
ActionType | |
DescriptionFromType | |
Restriction | |
HasPopup | |
MarkerType | |
Rect | |
FindParams | |
SetDocumentSelectionParams | |
AutomationIntent | |
AutomationEvent | |
TreeChange | |
CustomAction | |
LanguageSpan | |
Marker | |
AutomationPosition | |
AutomationNode | |
Methods | |
getTree −
chrome.automation.getTree(integer tabId, function callback)
| |
getDesktop −
chrome.automation.getDesktop(function callback)
| |
getFocus −
chrome.automation.getFocus(function callback)
| |
getAccessibilityFocus −
chrome.automation.getAccessibilityFocus(function callback)
| |
addTreeChangeObserver −
chrome.automation.addTreeChangeObserver(enum of
| |
removeTreeChangeObserver −
chrome.automation.removeTreeChangeObserver(function observer)
| |
setDocumentSelection −
chrome.automation.setDocumentSelection( SetDocumentSelectionParams params)
|
Types
EventType
Enum |
---|
"activedescendantchanged" ,
"alert" ,
"ariaAttributeChanged" ,
"autocorrectionOccured" ,
"blur" ,
"checkedStateChanged" ,
"childrenChanged" ,
"clicked" ,
"controlsChanged" ,
"documentSelectionChanged" ,
"documentTitleChanged" ,
"endOfTest" ,
"expandedChanged" ,
"focus" ,
"focusAfterMenuClose" ,
"focusContext" ,
"hide" ,
"hitTestResult" ,
"hover" ,
"imageFrameUpdated" ,
"invalidStatusChanged" ,
"layoutComplete" ,
"liveRegionChanged" ,
"liveRegionCreated" ,
"loadComplete" ,
"loadStart" ,
"locationChanged" ,
"mediaStartedPlaying" ,
"mediaStoppedPlaying" ,
"menuEnd" ,
"menuListItemSelected" ,
"menuListValueChanged" ,
"menuPopupEnd" ,
"menuPopupStart" ,
"menuStart" ,
"mouseCanceled" ,
"mouseDragged" ,
"mouseMoved" ,
"mousePressed" ,
"mouseReleased" ,
"rowCollapsed" ,
"rowCountChanged" ,
"rowExpanded" ,
"scrollPositionChanged" ,
"scrolledToAnchor" ,
"selectedChildrenChanged" ,
"selection" ,
"selectionAdd" ,
"selectionRemove" ,
"show" ,
"stateChanged" ,
"textChanged" ,
"textSelectionChanged" ,
"tooltipClosed" ,
"tooltipOpened" ,
"windowActivated" ,
"windowDeactivated" ,
"windowVisibilityChanged" ,
"treeChanged" ,
or "valueChanged"
|
RoleType
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" ,
"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" ,
"docPageList" ,
"docPart" ,
"docPreface" ,
"docPrologue" ,
"docPullquote" ,
"docQna" ,
"docSubtitle" ,
"docTip" ,
"docToc" ,
"embeddedObject" ,
"emphasis" ,
"feed" ,
"figcaption" ,
"figure" ,
"footer" ,
"footerAsNonLandmark" ,
"form" ,
"genericContainer" ,
"graphicsObject" ,
"graphicsSymbol" ,
"group" ,
"header" ,
"headerAsNonLandmark" ,
"heading" ,
"iframe" ,
"iframePresentational" ,
"ignored" ,
"image" ,
"imageMap" ,
"imeCandidate" ,
"inlineTextBox" ,
"inputTime" ,
"keyboard" ,
"labelText" ,
"layoutTable" ,
"layoutTableCell" ,
"layoutTableRow" ,
"legend" ,
"lineBreak" ,
"link" ,
"list" ,
"listBox" ,
"listBoxOption" ,
"listGrid" ,
"listMarker" ,
"log" ,
"main" ,
"mark" ,
"marquee" ,
"math" ,
"menu" ,
"menuBar" ,
"menuButton" ,
"menuItem" ,
"menuItemCheckBox" ,
"menuItemRadio" ,
"menuListOption" ,
"menuListPopup" ,
"meter" ,
"navigation" ,
"note" ,
"pane" ,
"paragraph" ,
"pdfActionableHighlight" ,
"popUpButton" ,
"portal" ,
"pre" ,
"presentational" ,
"progressIndicator" ,
"radioButton" ,
"radioGroup" ,
"region" ,
"rootWebArea" ,
"row" ,
"rowGroup" ,
"rowHeader" ,
"ruby" ,
"rubyAnnotation" ,
"scrollBar" ,
"scrollView" ,
"search" ,
"searchBox" ,
"section" ,
"slider" ,
"sliderThumb" ,
"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" ,
"webArea" ,
"webView" ,
or "window"
|
StateType
Enum |
---|
"autofillAvailable" ,
"collapsed" ,
"default" ,
"editable" ,
"expanded" ,
"focusable" ,
"focused" ,
"horizontal" ,
"hovered" ,
"ignored" ,
"invisible" ,
"linked" ,
"multiline" ,
"multiselectable" ,
"offscreen" ,
"protected" ,
"required" ,
"richlyEditable" ,
"vertical" ,
or "visited"
|
ActionType
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"
|
DescriptionFromType
Enum |
---|
"uninitialized" ,
"attribute" ,
"contents" ,
"relatedElement" ,
or "title"
|
Restriction
Enum |
---|
"disabled" ,
or "readOnly"
|
HasPopup
Enum |
---|
"true" ,
"menu" ,
"listbox" ,
"tree" ,
"grid" ,
or "dialog"
|
MarkerType
Enum |
---|
"spelling" ,
"grammar" ,
"textMatch" ,
"activeSuggestion" ,
or "suggestion"
|
Rect
properties | ||
---|---|---|
integer | left | |
integer | top | |
integer | width | |
integer | height |
FindParams
properties | ||
---|---|---|
RoleType | (optional) role | |
object | (optional) state |
A map of automation.StateType to boolean, indicating for each state whether it should be set or not. For example: |
object | (optional) attributes |
A map of attribute name to expected value, for example
|
SetDocumentSelectionParams
properties | ||
---|---|---|
AutomationNode | anchorObject |
The node where the selection begins. |
integer | anchorOffset |
The offset in the anchor node where the selection begins. |
AutomationNode | focusObject |
The node where the selection ends. |
integer | focusOffset |
The offset within the focus node where the selection ends. |
AutomationIntent
properties | ||
---|---|---|
enum of "clearSelection" , "cut" , "delete" , "dictate" , "extendSelection" , "format" , "insert" , "marker" , "moveSelection" , "paste" , "replace" , "setSelection" , or "type" |
command |
A command associated with this AutomationEvent. |
enum of "character" , "format" , "lineEnd" , "lineStart" , "lineStartOrEnd" , "object" , "pageEnd" , "pageStart" , "pageStartOrEnd" , "paragraphEnd" , "paragraphStart" , "paragraphStartOrEnd" , "sentenceEnd" , "sentenceStart" , "sentenceStartOrEnd" , "webPage" , "wordEnd" , "wordStart" , or "wordStartOrEnd" |
textBoundary |
A text boundary associated with this AutomationEvent. |
enum of "forward" , or "backward" |
moveDirection |
A move direction associated with this AutomationEvent. |
AutomationEvent
properties | ||
---|---|---|
AutomationNode | target |
The automation.AutomationNode to which the event was targeted. |
EventType | type |
The type of the event. |
string | eventFrom |
The source of this event. |
integer | mouseX | |
integer | mouseY | |
array of AutomationIntent | intents |
Intents associated with this event. |
function | stopPropagation |
Stops this event from further processing except for any remaining listeners on AutomationEvent.target. |
TreeChange
properties | ||
---|---|---|
AutomationNode | target |
The automation.AutomationNode that changed. |
enum of "nodeCreated" , "subtreeCreated" , "nodeChanged" , "textChanged" , "nodeRemoved" , or "subtreeUpdateEnd" |
type |
The type of change.
|
CustomAction
properties | ||
---|---|---|
integer | id | |
string | description |
LanguageSpan
properties | ||
---|---|---|
integer | startIndex |
Inclusive start index of substring that contains language. |
integer | endIndex |
Exclusive end index of substring that contains language. |
string | language |
Detected language for substring. |
double | probability |
Probability that language is correct. |
Marker
properties | ||
---|---|---|
integer | startOffset |
The start offset within the text of the associated node. |
integer | endOffset |
The end offset within the text of the associated node. |
object | flags |
A mapping of MarkerType to true or undefined indicating the marker types for this marker. |
AutomationPosition
Not fully implemented. You must build Chromium from source to try this API. Learn more.
properties | ||
---|---|---|
AutomationNode | (optional) node | |
integer | childIndex | |
integer | textOffset | |
string | affinity | |
function | isNullPosition |
Returns boolean. |
function | isTreePosition |
Returns boolean. |
function | isTextPosition |
Returns boolean. |
function | isLeafTextPosition |
Returns boolean. |
function | atStartOfAnchor |
Returns boolean. |
function | atEndOfAnchor |
Returns boolean. |
function | atStartOfWord |
Returns boolean. |
function | atEndOfWord |
Returns boolean. |
function | atStartOfLine |
Returns boolean. |
function | atEndOfLine |
Returns boolean. |
function | atStartOfParagraph |
Returns boolean. |
function | atEndOfParagraph |
Returns boolean. |
function | atStartOfPage |
Returns boolean. |
function | atEndOfPage |
Returns boolean. |
function | atStartOfFormat |
Returns boolean. |
function | atEndOfFormat |
Returns boolean. |
function | atStartOfDocument |
Returns boolean. |
function | atEndOfDocument |
Returns boolean. |
function | asTreePosition | |
function | asTextPosition | |
function | asLeafTextPosition | |
function | moveToPositionAtStartOfAnchor | |
function | moveToPositionAtEndOfAnchor | |
function | moveToPositionAtStartOfDocument | |
function | moveToPositionAtEndOfDocument | |
function | moveToParentPosition | |
function | moveToNextLeafTreePosition | |
function | moveToPreviousLeafTreePosition | |
function | moveToNextLeafTextPosition | |
function | moveToPreviousLeafTextPosition | |
function | moveToNextCharacterPosition | |
function | moveToPreviousCharacterPosition | |
function | moveToNextWordStartPosition | |
function | moveToPreviousWordStartPosition | |
function | moveToNextWordEndPosition | |
function | moveToPreviousWordEndPosition | |
function | moveToNextLineStartPosition | |
function | moveToPreviousLineStartPosition | |
function | moveToNextLineEndPosition | |
function | moveToPreviousLineEndPosition | |
function | moveToPreviousFormatStartPosition | |
function | moveToNextFormatEndPosition | |
function | moveToNextParagraphStartPosition | |
function | moveToPreviousParagraphStartPosition | |
function | moveToNextParagraphEndPosition | |
function | moveToPreviousParagraphEndPosition | |
function | moveToNextPageStartPosition | |
function | moveToPreviousPageStartPosition | |
function | moveToNextPageEndPosition | |
function | moveToPreviousPageEndPosition | |
function | moveToNextAnchorPosition | |
function | moveToPreviousAnchorPosition | |
function | maxTextOffset |
Returns integer. |
function | isInLineBreak |
Returns boolean. |
function | isInTextObject |
Returns boolean. |
function | isInWhiteSpace |
Returns boolean. |
function | isValid |
Returns boolean. |
function | getText |
Returns string. |
AutomationNode
properties | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AutomationNode | (optional) root |
The root node of the tree containing this AutomationNode. |
||||||||||||||||||
boolean | isRootNode |
Whether this AutomationNode is a root node. |
||||||||||||||||||
RoleType | (optional) role |
The role of this node. |
||||||||||||||||||
object | (optional) state |
The automation.StateTypes describing this node. |
||||||||||||||||||
Rect | (optional) location |
The rendered location (as a bounding box) of this node in global screen coordinates. |
||||||||||||||||||
function | boundsForRange |
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.
|
||||||||||||||||||
Rect | (optional) unclippedLocation |
The location (as a bounding box) of this node in global screen coordinates without applying any clipping from ancestors. |
||||||||||||||||||
string | (optional) description |
The purpose of the node, other than the role, if any. |
||||||||||||||||||
string | (optional) placeholder |
The placeholder for this text field, if any. |
||||||||||||||||||
string | (optional) roleDescription |
The role description for this node. |
||||||||||||||||||
string | (optional) name |
The accessible name for this node, via the Accessible Name Calculation process. |
||||||||||||||||||
string | (optional) tooltip |
The tooltip of the node, if any. |
||||||||||||||||||
enum of "uninitialized" , "attribute" , "attributeExplicitlyEmpty" , "caption" , "contents" , "placeholder" , "relatedElement" , "title" , or "value" |
(optional) nameFrom |
The source of the name. |
||||||||||||||||||
string | (optional) imageAnnotation |
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. |
||||||||||||||||||
string | (optional) value |
The value for this node: for example the |
||||||||||||||||||
string | (optional) htmlTag |
The HTML tag for this element, if this node is an HTML element. |
||||||||||||||||||
integer | (optional) hierarchicalLevel |
The level of a heading or tree item. |
||||||||||||||||||
array of integer | (optional) wordStarts |
The start and end index of each word in an inline text box. |
||||||||||||||||||
array of integer | (optional) wordEnds | |||||||||||||||||||
array of integer | (optional) nonInlineTextWordStarts |
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. |
||||||||||||||||||
array of integer | (optional) nonInlineTextWordEnds |
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. |
||||||||||||||||||
array of AutomationNode | (optional) controls |
The nodes, if any, which this node is specified to control via |
||||||||||||||||||
array of AutomationNode | (optional) describedBy |
The nodes, if any, which form a description for this node. |
||||||||||||||||||
array of AutomationNode | (optional) flowTo |
The nodes, if any, which may optionally be navigated to after this one. See |
||||||||||||||||||
array of AutomationNode | (optional) labelledBy |
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. |
||||||||||||||||||
AutomationNode | (optional) activeDescendant |
The node referred to by |
||||||||||||||||||
array of AutomationNode | (optional) activeDescendantFor |
Reverse relationship for active descendant. |
||||||||||||||||||
AutomationNode | (optional) inPageLinkTarget |
The target of an in-page link. |
||||||||||||||||||
array of AutomationNode | (optional) details |
A node that provides more details about the current node. |
||||||||||||||||||
AutomationNode | (optional) errorMessage |
A node that provides an error message for a current node. |
||||||||||||||||||
array of AutomationNode | (optional) detailsFor |
Reverse relationship for details. |
||||||||||||||||||
array of AutomationNode | (optional) errorMessageFor |
Reverse relationship for errorMessage. |
||||||||||||||||||
array of AutomationNode | (optional) controlledBy |
Reverse relationship for controls. |
||||||||||||||||||
array of AutomationNode | (optional) descriptionFor |
Reverse relationship for describedBy. |
||||||||||||||||||
array of AutomationNode | (optional) flowFrom |
Reverse relationship for flowTo. |
||||||||||||||||||
array of AutomationNode | (optional) labelFor |
Reverse relationship for labelledBy. |
||||||||||||||||||
array of AutomationNode | (optional) tableCellColumnHeaders |
The column header nodes for a table cell. |
||||||||||||||||||
array of AutomationNode | (optional) tableCellRowHeaders |
The row header nodes for a table cell. |
||||||||||||||||||
array of ActionType | (optional) standardActions |
An array of standard actions available on this node. |
||||||||||||||||||
array of CustomAction | (optional) customActions |
An array of custom actions. |
||||||||||||||||||
enum of "activate" , "check" , "click" , "clickAncestor" , "jump" , "open" , "press" , "select" , or "uncheck" |
(optional) defaultActionVerb |
The action taken by calling |
||||||||||||||||||
string | (optional) url |
The URL that this link will navigate to. |
||||||||||||||||||
string | (optional) docUrl |
The URL of this document. |
||||||||||||||||||
string | (optional) docTitle |
The title of this document. |
||||||||||||||||||
boolean | (optional) docLoaded |
Whether this document has finished loading. |
||||||||||||||||||
double | (optional) docLoadingProgress |
The proportion (out of 1.0) that this doc has completed loading. |
||||||||||||||||||
integer | (optional) scrollX |
Scrollable container attributes. |
||||||||||||||||||
integer | (optional) scrollXMin | |||||||||||||||||||
integer | (optional) scrollXMax | |||||||||||||||||||
integer | (optional) scrollY | |||||||||||||||||||
integer | (optional) scrollYMin | |||||||||||||||||||
integer | (optional) scrollYMax | |||||||||||||||||||
boolean | (optional) scrollable |
Indicates whether this node is scrollable. |
||||||||||||||||||
integer | (optional) textSelStart |
The character index of the start of the selection within this editable text element; -1 if no selection. |
||||||||||||||||||
integer | (optional) textSelEnd |
The character index of the end of the selection within this editable text element; -1 if no selection. |
||||||||||||||||||
string | (optional) textInputType |
The input type, like email or number. |
||||||||||||||||||
array of Marker | (optional) markers |
An array of Marker objects for this node. |
||||||||||||||||||
boolean | (optional) isSelectionBackward |
If a selection is present, whether the anchor of the selection comes after its focus in the accessibility tree. |
||||||||||||||||||
AutomationNode | (optional) anchorObject |
The anchor node of the tree selection, if any. |
||||||||||||||||||
integer | (optional) anchorOffset |
The anchor offset of the tree selection, if any. |
||||||||||||||||||
string | (optional) anchorAffinity |
The affinity of the tree selection anchor, if any. |
||||||||||||||||||
AutomationNode | (optional) focusObject |
The focus node of the tree selection, if any. |
||||||||||||||||||
integer | (optional) focusOffset |
The focus offset of the tree selection, if any. |
||||||||||||||||||
string | (optional) focusAffinity |
The affinity of the tree selection focus, if any. |
||||||||||||||||||
AutomationNode | (optional) selectionStartObject |
The selection start node of the tree selection, if any. |
||||||||||||||||||
integer | (optional) selectionStartOffset |
The selection start offset of the tree selection, if any. |
||||||||||||||||||
string | (optional) selectionStartAffinity |
The affinity of the tree selection start, if any. |
||||||||||||||||||
AutomationNode | (optional) selectionEndObject |
The selection end node of the tree selection, if any. |
||||||||||||||||||
integer | (optional) selectionEndOffset |
The selection end offset of the tree selection, if any. |
||||||||||||||||||
string | (optional) selectionEndAffinity |
The affinity of the tree selection end, if any. |
||||||||||||||||||
double | (optional) valueForRange |
The current value for this range. |
||||||||||||||||||
double | (optional) minValueForRange |
The minimum possible value for this range. |
||||||||||||||||||
double | (optional) maxValueForRange |
The maximum possible value for this range. |
||||||||||||||||||
integer | (optional) posInSet |
The 1-based index of an item in a set. |
||||||||||||||||||
integer | (optional) setSize |
The number of items in a set; |
||||||||||||||||||
integer | (optional) tableRowCount |
The number of rows in this table as specified in the DOM. |
||||||||||||||||||
integer | (optional) ariaRowCount |
The number of rows in this table as specified by the page author. |
||||||||||||||||||
integer | (optional) tableColumnCount |
The number of columns in this table as specified in the DOM. |
||||||||||||||||||
integer | (optional) ariaColumnCount |
The number of columns in this table as specified by the page author. |
||||||||||||||||||
integer | (optional) tableCellColumnIndex |
The zero-based index of the column that this cell is in as specified in the DOM. |
||||||||||||||||||
integer | (optional) tableCellAriaColumnIndex |
The ARIA column index as specified by the page author. |
||||||||||||||||||
integer | (optional) tableCellColumnSpan |
The number of columns that this cell spans (default is 1). |
||||||||||||||||||
integer | (optional) tableCellRowIndex |
The zero-based index of the row that this cell is in as specified in the DOM. |
||||||||||||||||||
integer | (optional) tableCellAriaRowIndex |
The ARIA row index as specified by the page author. |
||||||||||||||||||
integer | (optional) tableCellRowSpan |
The number of rows that this cell spans (default is 1). |
||||||||||||||||||
AutomationNode | (optional) tableColumnHeader |
The corresponding column header for this cell. |
||||||||||||||||||
AutomationNode | (optional) tableRowHeader |
The corresponding row header for this cell. |
||||||||||||||||||
integer | (optional) tableColumnIndex |
The column index of this column node. |
||||||||||||||||||
integer | (optional) tableRowIndex |
The row index of this row node. |
||||||||||||||||||
string | (optional) liveStatus |
The type of region if this is the root of a live region. Possible values are 'polite' and 'assertive'. |
||||||||||||||||||
string | (optional) liveRelevant |
The value of aria-relevant for a live region. |
||||||||||||||||||
boolean | (optional) liveAtomic |
The value of aria-atomic for a live region. |
||||||||||||||||||
boolean | (optional) busy |
The value of aria-busy for a live region or any other element. |
||||||||||||||||||
string | (optional) containerLiveStatus |
The type of live region if this node is inside a live region. |
||||||||||||||||||
string | (optional) containerLiveRelevant |
The value of aria-relevant if this node is inside a live region. |
||||||||||||||||||
boolean | (optional) containerLiveAtomic |
The value of aria-atomic if this node is inside a live region. |
||||||||||||||||||
boolean | (optional) containerLiveBusy |
The value of aria-busy if this node is inside a live region. |
||||||||||||||||||
string | (optional) autoComplete |
Aria auto complete. |
||||||||||||||||||
string | (optional) className |
The name of the programmatic backing object. |
||||||||||||||||||
boolean | (optional) modal |
Marks this subtree as modal. |
||||||||||||||||||
object | (optional) htmlAttributes |
A map containing all HTML attributes and their values |
||||||||||||||||||
string | (optional) inputType |
The input type of a text field, such as "text" or "email". |
||||||||||||||||||
string | (optional) accessKey |
The key that activates this widget. |
||||||||||||||||||
string | (optional) ariaInvalidValue |
The value of the aria-invalid attribute, indicating the error type. |
||||||||||||||||||
string | (optional) display |
The CSS display attribute for this node, if applicable. |
||||||||||||||||||
string | (optional) imageDataUrl |
A data url with the contents of this object's image or thumbnail. |
||||||||||||||||||
string | (optional) language |
The author-provided language code for this subtree. |
||||||||||||||||||
string | (optional) detectedLanguage |
The detected language code for this subtree. |
||||||||||||||||||
string | (optional) hasPopup |
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 |
||||||||||||||||||
string | (optional) restriction |
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 |
||||||||||||||||||
string | (optional) checked |
Tri-state describing checkbox or radio button: 'false' | 'true' | 'mixed' |
||||||||||||||||||
string | (optional) innerHtml |
The inner html of this element. Only populated for math content. |
||||||||||||||||||
integer | (optional) color |
The RGBA foreground color of this subtree, as an integer. |
||||||||||||||||||
integer | (optional) backgroundColor |
The RGBA background color of this subtree, as an integer. |
||||||||||||||||||
integer | (optional) colorValue |
The RGBA color of an input element whose value is a color. |
||||||||||||||||||
boolean | subscript |
Indicates node text is subscript. |
||||||||||||||||||
boolean | superscript |
Indicates node text is superscript. |
||||||||||||||||||
boolean | bold |
Indicates node text is bold. |
||||||||||||||||||
boolean | italic |
Indicates node text is italic. |
||||||||||||||||||
boolean | underline |
Indicates node text is underline. |
||||||||||||||||||
boolean | lineThrough |
Indicates node text is line through. |
||||||||||||||||||
boolean | (optional) selected |
Indicates whether this node is selected, unselected, or neither. |
||||||||||||||||||
integer | (optional) fontSize |
Indicates the font size of this node. |
||||||||||||||||||
string | fontFamily |
Indicates the font family. |
||||||||||||||||||
boolean | editableRoot |
Indicates whether this is a root of an editable subtree. |
||||||||||||||||||
array of AutomationNode | children |
Walking the tree. |
||||||||||||||||||
AutomationNode | (optional) parent | |||||||||||||||||||
AutomationNode | (optional) firstChild | |||||||||||||||||||
AutomationNode | (optional) lastChild | |||||||||||||||||||
AutomationNode | (optional) previousSibling | |||||||||||||||||||
AutomationNode | (optional) nextSibling | |||||||||||||||||||
AutomationNode | (optional) previousOnLine | |||||||||||||||||||
AutomationNode | (optional) nextOnLine | |||||||||||||||||||
AutomationNode | (optional) previousFocus | |||||||||||||||||||
AutomationNode | (optional) nextFocus | |||||||||||||||||||
integer | (optional) indexInParent |
The index of this node in its parent node's list of children. If this is the root node, this will be undefined. |
||||||||||||||||||
function | doDefault |
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. |
||||||||||||||||||
function | focus |
Places focus on this node. |
||||||||||||||||||
function | getImageData |
Request a data url for the contents of an image, optionally resized. Pass zero for maxWidth and/or maxHeight for the original size.
|
||||||||||||||||||
function | hitTest |
Does a hit test of the given global screen coordinates, and fires eventToFire on the resulting object.
|
||||||||||||||||||
function | hitTestWithReply |
Does a automation.AutomationNode.hitTest, and receives a callback with the resulting hit node.
|
||||||||||||||||||
function | makeVisible |
Scrolls this node to make it visible. |
||||||||||||||||||
function | performCustomAction |
Performs custom action.
|
||||||||||||||||||
function | performStandardAction |
Convenience method to perform a standard action supported by this node. For actions requiring additional arguments, call the specific binding e.g.
|
||||||||||||||||||
function | replaceSelectedText |
Replaces the selected text within a text field.
|
||||||||||||||||||
function | setAccessibilityFocus |
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. |
||||||||||||||||||
function | setSelection |
Sets selection within a text field.
|
||||||||||||||||||
function | setSequentialFocusNavigationStartingPoint |
Clears focus and sets this node as the starting point for the next time the user presses Tab or Shift+Tab. |
||||||||||||||||||
function | setValue |
Sets the value of a text field.
|
||||||||||||||||||
function | showContextMenu |
Show the context menu for this element, as if the user right-clicked. |
||||||||||||||||||
function | resumeMedia |
Resume playing any media within this tree. |
||||||||||||||||||
function | startDuckingMedia |
Start ducking any media within this tree. |
||||||||||||||||||
function | stopDuckingMedia |
Stop ducking any media within this tree. |
||||||||||||||||||
function | suspendMedia |
Suspend any media playing within this tree. |
||||||||||||||||||
function | scrollBackward |
Scrolls this scrollable container backward. |
||||||||||||||||||
function | scrollForward |
Scrolls this scrollable container forward. |
||||||||||||||||||
function | scrollUp |
Scrolls this scrollable container up. |
||||||||||||||||||
function | scrollDown |
Scrolls this scrollable container down. |
||||||||||||||||||
function | scrollLeft |
Scrolls this scrollable container left. |
||||||||||||||||||
function | scrollRight |
Scrolls this scrollable container right. |
||||||||||||||||||
function | scrollToPoint |
Not fully implemented. You must build Chromium from source to try this API. Learn more. Scrolls this scrollable container to the given point.
|
||||||||||||||||||
function | setScrollOffset |
Not fully implemented. You must build Chromium from source to try this API. Learn more. Sets this scrollable container's scroll offset.
|
||||||||||||||||||
function | addEventListener |
Adds a listener for the given event type and event phase.
|
||||||||||||||||||
function | removeEventListener |
Removes a listener for the given event type and event phase.
|
||||||||||||||||||
function | domQuerySelector |
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.
|
||||||||||||||||||
function | find |
Finds the first AutomationNode in this node's subtree which matches the given search parameters. Returns AutomationNode.
|
||||||||||||||||||
function | findAll |
Finds all the AutomationNodes in this node's subtree which matches the given search parameters. Returns array of AutomationNode.
|
||||||||||||||||||
function | matches |
Returns whether this node matches the given automation.FindParams. Returns boolean.
|
||||||||||||||||||
function | getNextTextMatch |
Returns AutomationNode.
|
||||||||||||||||||
function | languageAnnotationForStringAttribute |
Dev channel only. Learn more. 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. Returns array of LanguageSpan.
|
||||||||||||||||||
function | createPosition |
Not fully implemented. You must build Chromium from source to try this API. Learn more. Creates a position object backed by Chrome's accessibility position support. Returns AutomationPosition.
|
Methods
getTree
chrome.automation.getTree(integer tabId, function callback)
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 | |||||
---|---|---|---|---|---|
integer | (optional) tabId | ||||
function | (optional) callback |
Called when the If you specify the callback parameter, it should be a function that looks like this: function( AutomationNode rootNode) {...};
|
getDesktop
chrome.automation.getDesktop(function callback)
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 | |||||
---|---|---|---|---|---|
function | callback |
Called when the The callback parameter should be a function that looks like this: function( AutomationNode rootNode) {...};
|
getFocus
chrome.automation.getFocus(function callback)
Get the automation node that currently has focus, globally. Will return null if none of the nodes in any loaded trees have focus.
Parameters | |||||
---|---|---|---|---|---|
function | callback |
Called with the The callback parameter should be a function that looks like this: function( AutomationNode focusedNode) {...};
|
getAccessibilityFocus
chrome.automation.getAccessibilityFocus(function callback)
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 | |||||
---|---|---|---|---|---|
function | callback |
Called with the The callback parameter should be a function that looks like this: function( AutomationNode focusedNode) {...};
|
addTreeChangeObserver
chrome.automation.addTreeChangeObserver(enum of "noTreeChanges"
, "liveRegionTreeChanges"
, "textMarkerChanges"
, or "allTreeChanges"
filter, function observer)
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 | |||||
---|---|---|---|---|---|
enum of "noTreeChanges" , "liveRegionTreeChanges" , "textMarkerChanges" , or "allTreeChanges" |
filter | ||||
function | observer |
A listener for changes on the The observer parameter should be a function that looks like this: function( TreeChange treeChange) {...};
|
removeTreeChangeObserver
chrome.automation.removeTreeChangeObserver(function observer)
Remove a tree change observer.
Parameters | |||||
---|---|---|---|---|---|
function | observer |
A listener for changes on the The observer parameter should be a function that looks like this: function( TreeChange treeChange) {...};
|
setDocumentSelection
chrome.automation.setDocumentSelection( SetDocumentSelectionParams params)
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.
Parameters | ||
---|---|---|
SetDocumentSelectionParams | params |