You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tool-reference.md
+19-9Lines changed: 19 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@
43
43
**Parameters:**
44
44
45
45
-**dblClick** (boolean) _(optional)_: Set to true for double clicks. Default is false.
46
-
-**uid** (number) **(required)**: The uid of an element on the page from the page content snapshot
46
+
-**uid** (string) **(required)**: The uid of an element on the page from the page content snapshot
47
47
48
48
---
49
49
@@ -53,8 +53,8 @@
53
53
54
54
**Parameters:**
55
55
56
-
-**from_uid** (number) **(required)**: The uid of the element to [`drag`](#drag)
57
-
-**to_uid** (number) **(required)**: The uid of the element to drop into
56
+
-**from_uid** (string) **(required)**: The uid of the element to [`drag`](#drag)
57
+
-**to_uid** (string) **(required)**: The uid of the element to drop into
58
58
59
59
---
60
60
@@ -64,7 +64,7 @@
64
64
65
65
**Parameters:**
66
66
67
-
-**uid** (number) **(required)**: The uid of an element on the page from the page content snapshot
67
+
-**uid** (string) **(required)**: The uid of an element on the page from the page content snapshot
68
68
-**value** (string) **(required)**: The value to [`fill`](#fill) in
69
69
70
70
---
@@ -96,7 +96,7 @@
96
96
97
97
**Parameters:**
98
98
99
-
-**uid** (number) **(required)**: The uid of an element on the page from the page content snapshot
99
+
-**uid** (string) **(required)**: The uid of an element on the page from the page content snapshot
100
100
101
101
---
102
102
@@ -107,7 +107,7 @@
107
107
**Parameters:**
108
108
109
109
-**filePath** (string) **(required)**: The local path of the file to upload
110
-
-**uid** (number) **(required)**: The uid of the file input element or an element that will open file chooser on the page from the page content snapshot
110
+
-**uid** (string) **(required)**: The uid of the file input element or an element that will open file chooser on the page from the page content snapshot
111
111
112
112
---
113
113
@@ -259,11 +259,21 @@
259
259
260
260
### `evaluate_script`
261
261
262
-
**Description:** Evaluate a JavaScript function inside the currently selected page. Returns the response as JSON.
262
+
**Description:** Evaluate a JavaScript function inside the currently selected page. Returns the response as JSON
263
+
so returned values have to JSON-serializable.
263
264
264
265
**Parameters:**
265
266
266
-
-**function** (string) **(required)**: A JavaScript function to run in the currently selected page. Example: `() => {return document.title}` or `async () => {return await fetch("example.com")}`
267
+
-**args** (array) _(optional)_: An optional list of arguments to pass to the function.
268
+
-**function** (string) **(required)**: A JavaScript function to run in the currently selected page.
269
+
Example without arguments: `() => {
270
+
return document.title
271
+
}` or `async () => {
272
+
return await fetch("example.com")
273
+
}`.
274
+
Example with arguments: `(el) => {
275
+
return el.innerText;
276
+
}`
267
277
268
278
---
269
279
@@ -283,7 +293,7 @@
283
293
284
294
-**format** (enum: "png", "jpeg") _(optional)_: Type of format to save the screenshot as. Default is "png"
285
295
-**fullPage** (boolean) _(optional)_: If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid.
286
-
-**uid** (number) _(optional)_: The uid of an element on the page from the page content snapshot. If omitted takes a pages screenshot.
296
+
-**uid** (string) _(optional)_: The uid of an element on the page from the page content snapshot. If omitted takes a pages screenshot.
0 commit comments