From f5c97b8f0e0355145c378cb70551d595825fd501 Mon Sep 17 00:00:00 2001 From: junhsss Date: Fri, 13 Nov 2026 00:05:47 +0900 Subject: [PATCH 1/3] fix(browser): cancel on Ctrl-C, 15-minute sessions and output fixes --- docs/cli-reference.md | 7 +- docs/references/steel-browser-commands.md | 6 +- src/api/commands.rs | 9 +- src/commands/browser/action.rs | 260 +++++++++++++++++++++- src/commands/browser/start.rs | 13 +- src/util/output.rs | 1 + tests/browser_commands.rs | 155 ++++++++++++- 7 files changed, 415 insertions(+), 36 deletions(-) diff --git a/docs/cli-reference.md b/docs/cli-reference.md index 6be386c..4af3e7f 100644 --- a/docs/cli-reference.md +++ b/docs/cli-reference.md @@ -213,7 +213,7 @@ steel browser - `mouse`: Mouse input at a point, for canvases and maps - `snapshot`: Take an accessibility tree snapshot with element refs - `screenshot`: Take a screenshot -- `pdf`: Save the page as a PDF (headless sessions only) +- `pdf`: Save the page as a PDF - `eval`: Run JavaScript in the page and print its value - `find`: Find elements and print their refs - `content`: Get the page HTML @@ -238,7 +238,7 @@ steel browser start - `--stealth` (boolean, optional): Enable stealth mode (humanize interactions + auto CAPTCHA) - `-p, --proxy` (string, optional): Use a residential proxy -- `--timeout` (string, optional): Session timeout in milliseconds (create-time only) +- `--timeout` (string, optional): Session timeout in milliseconds. Defaults to 900000 (15 minutes), which every plan allows (create-time only) - `--inactivity-timeout` (string, optional): Inactivity timeout in milliseconds: release the session when no command, CDP message, or remote input arrives for this long. Defaults to 600000 (10 minutes); pass 0 to disable (create-time only) - `--solve-captcha` (boolean, optional): Enable manual CAPTCHA solving on new sessions (create-time only) - `--profile` (string, optional): Named profile to load (see `steel profile list`) @@ -698,7 +698,7 @@ steel browser screenshot ## steel browser pdf -Save the page as a PDF (headless sessions only) +Save the page as a PDF ### Usage @@ -725,6 +725,7 @@ steel browser eval ### Parameters - `script` (string, required): JavaScript expression or function body; its value is printed +- `--timeout` (string, optional): Time limit in milliseconds (default 10000, at most 50000) ## steel browser find diff --git a/docs/references/steel-browser-commands.md b/docs/references/steel-browser-commands.md index 804a3a2..aa0dfd7 100644 --- a/docs/references/steel-browser-commands.md +++ b/docs/references/steel-browser-commands.md @@ -82,9 +82,9 @@ steel browser get box steel browser is visible|enabled|checked steel browser find # CSS by default; --by role|text|label|placeholder|alt|title|testid, --name, --exact steel browser content # page HTML -steel browser eval