/
autofill-field.ts
109 lines (100 loc) · 2.62 KB
/
autofill-field.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/**
* Represents a single field that is collected from the page source and is potentially autofilled.
*/
export default class AutofillField {
[key: string]: any;
/**
* The unique identifier assigned to this field during collection of the page details
*/
opid: string;
/**
* Sequential number assigned to each element collected, based on its position in the DOM.
* Used to do perform proximal checks for username and password fields on the DOM.
*/
elementNumber: number;
/**
* Designates whether the field is viewable on the current part of the DOM that the user can see
*/
viewable: boolean;
/**
* The HTML `id` attribute of the field
*/
htmlID: string | null;
/**
* The HTML `name` attribute of the field
*/
htmlName: string | null;
/**
* The HTML `class` attribute of the field
*/
htmlClass: string | null;
tabindex: string | null;
title: string | null;
/**
* The `tagName` for the field
*/
tagName?: string | null;
/**
* The concatenated `innerText` or `textContent` of all the elements that are to the "left" of the field in the DOM
*/
"label-left"?: string;
/**
* The concatenated `innerText` or `textContent` of all the elements that are to the "right" of the field in the DOM
*/
"label-right"?: string;
/**
* For fields in a data table, the contents of the table row immediately above the field
*/
"label-top"?: string;
/**
* The concatenated `innerText` or `textContent` of all elements that are HTML labels for the field
*/
"label-tag"?: string;
/**
* The `aria-label` attribute for the field
*/
"label-aria"?: string | null;
"label-data"?: string | null;
"aria-hidden"?: boolean;
"aria-disabled"?: boolean;
"aria-haspopup"?: boolean;
"data-stripe"?: string | null;
/**
* The HTML `placeholder` attribute for the field
*/
placeholder?: string | null;
/**
* The HTML `type` attribute for the field
*/
type?: string;
/**
* The HTML `value` for the field
*/
value?: string;
/**
* The `disabled` status of the field
*/
disabled?: boolean;
/**
* The `readonly` status of the field
*/
readonly?: boolean;
/**
* The `opid` attribute value of the form that contains the field
*/
form?: string;
/**
* The `x-autocompletetype`, `autocompletetype`, or `autocomplete` attribute for the field
*/
autoCompleteType?: string | null;
/**
* For `<select>` elements, an array of the element's option `text` values
*/
selectInfo?: any;
/**
* The `maxLength` attribute for the field
*/
maxLength?: number | null;
rel?: string | null;
checked?: boolean;
}