mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-30 19:59:35 +00:00
fix(browser): accept statement evaluate bodies
This commit is contained in:
@@ -194,11 +194,14 @@ openclaw browser select <ref> OptionA OptionB
|
||||
openclaw browser fill --fields '[{"ref":"1","value":"Ada"}]'
|
||||
openclaw browser wait --text "Done"
|
||||
openclaw browser evaluate --fn '(el) => el.textContent' --ref <ref>
|
||||
openclaw browser evaluate --fn 'const title = document.title; return title;'
|
||||
openclaw browser evaluate --timeout-ms 30000 --fn 'async () => { await window.ready; return true; }'
|
||||
```
|
||||
|
||||
Use `evaluate --timeout-ms <ms>` when the page-side function may need longer
|
||||
than the default evaluate timeout.
|
||||
`evaluate --fn` accepts a function source, an expression, or a statement body.
|
||||
Statement bodies are wrapped as async functions, so use `return` for the value
|
||||
you want back. Use `evaluate --timeout-ms <ms>` when the page-side function may
|
||||
need longer than the default evaluate timeout.
|
||||
|
||||
Action responses return the current raw `targetId` after action-triggered page
|
||||
replacement when OpenClaw can prove the replacement tab. Scripts should still
|
||||
|
||||
Reference in New Issue
Block a user