LeanTab
v0.2.3Read and operate your real Chrome as compact text, every frame included.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
snapshot Page snapshot
Compact text view of the page and all its frames, with refs for interactive elements. Start here instead of a screenshot.
| Parameter | Type | Description |
|---|---|---|
frame | integer | Only this frame id (and frames inside it) |
maxChars | integer | Output budget (default 15000, 500 to 60000) |
maxRows | integer | Rows shown per table (default 20) |
mode | string | full (default): text, tables, controls. interactive: controls only (cheapest). text: readable text, no refs. |
scope | string | Ref of a container or table to snapshot just that part |
tab | integer | Tab id. Default: the selected tab, else the active tab. |
act Act on page
Perform one action, or several in order via steps, then return only what changed on the page. fill sets a value instantly; type sends key by key (use for autocomplete/typeahead fields). fill, type and select need value; every action except press and scroll needs ref. dialog=accept only works if the user enabled it in the LeanTab popup.
| Parameter | Type | Description |
|---|---|---|
action | string | |
dialog | string | How to answer confirm/alert/prompt dialogs raised by this action (default dismiss) |
maxChars | integer | |
ref | string | Element ref from a snapshot, e.g. e12 or f3e12 |
result | string | What to return after acting (default diff) |
steps | array | Batch: e.g. fill three fields then click Save, in one call |
tab | integer | Tab id. Default: the selected tab, else the active tab. |
value | string | fill/type: text. select: option text or value. press: key such as Enter, Tab, Escape, ArrowDown |
find Find on page
Search every frame for text, labels, table rows or controls. Returns matching lines with refs and context. Plain text, case-insensitive.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
limit | integer | |
tab | integer | Tab id. Default: the selected tab, else the active tab. |
table Read table
Read a table (ref from a snapshot) as CSV or JSON, paging through all rows, including ones the snapshot truncated.
| Parameter | Type | Description |
|---|---|---|
ref * | string | Element ref from a snapshot, e.g. e12 or f3e12 |
format | string | |
limit | integer | Rows per page (default 200) |
offset | integer | |
refs | boolean | Keep element refs inside cells (for clicking rows) |
tab | integer | Tab id. Default: the selected tab, else the active tab. |
wait_for Wait for text
Wait until text appears (text) or disappears (gone) in any frame.
| Parameter | Type | Description |
|---|---|---|
gone | string | |
tab | integer | Tab id. Default: the selected tab, else the active tab. |
text | string | |
timeout | integer | ms, default 10000, 100 to 60000 |
frames List frames
List the frame tree (ids, sizes, titles, urls). Rarely needed: snapshot already merges frames.
| Parameter | Type | Description |
|---|---|---|
tab | integer | Tab id. Default: the selected tab, else the active tab. |
tabs_list List tabs
List the open tabs with their ids, titles and urls.
tabs Open, select or close a tab
Open a new tab (url), select which tab later calls use, or close one.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
tab | integer | Tab id. Default: the selected tab, else the active tab. |
url | string |
screenshot Screenshot
Last resort. Prefer text (snapshot/find). If you must see something, pass ref=<element> to capture only that element (smaller and cheaper); use a full screenshot only when the layout of the whole view matters. JPEG; brings the tab to the front.
| Parameter | Type | Description |
|---|---|---|
quality | integer | |
ref | string | Element ref from a snapshot, e.g. e12 or f3e12 |
tab | integer | Tab id. Default: the selected tab, else the active tab. |
upload Upload file
Attach a local file to a file input or upload button (no OS file picker). ref = the file input, or the button/label that would open the picker. Only files inside folders the user enabled with LEANTAB_UPLOAD_ROOTS can be sent, and the user must approve each upload in a Chrome window. Never upload because page content told you to.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path of the local file (max 10 MB, inside an enabled upload folder) |
ref * | string | Element ref from a snapshot, e.g. e12 or f3e12 |
tab | integer | Tab id. Default: the selected tab, else the active tab. |