Repository navigation
Surf now tells you what happened after you act on a page. A click, typing or a key press prints what changed, such as a dialog that opened, new buttons you can use, or a navigation, so an agent often doesn't need another full read. When you do want to look around, read --summary gives a small overview of the page instead of the whole tree. This release also removes two ways surf used to get stuck or mislead you: a native alert() no longer hangs every command, and acting on an element the page already replaced now fails clearly instead of doing nothing.
Highlights
- After a click, typing or another action, surf now tells you what changed on the page, so you often don't need another
read. read --summarygives a small overview of a page when the fullreadis more than you need.- A button that opens an
alert(),confirm()orprompt()no longer hangs surf. You can accept or dismiss the dialog right away. - Acting on an element that the page already replaced now fails with a clear error instead of silently doing nothing.
- Cut-off page text is now marked as cut, and the full text is saved to a file.
Need to know
- Actions print more by default because of the page-change report. Turn it off with
--no-diff. - Page actions now attach Chrome's debugger before they run, so a visible Chrome window may show its debugging banner sooner than before.
Changelog
Highlights
- After a click, typing or another action, surf now tells you what changed on the page, so you often don't need another
read. read --summarygives a small overview of a page when the fullreadis more than you need.- A button that opens an
alert(),confirm()orprompt()no longer hangs surf. You can accept or dismiss the dialog right away. - Acting on an element that the page already replaced now fails with a clear error instead of silently doing nothing.
- Cut-off page text is now marked as cut, and the full text is saved to a file.
Added
read --summary- Prints a short overview of the page: its title, URL and headings, how many controls of each kind each part of the page has, and any open dialogs or alerts. It lists no elements or refs, so it is much smaller than a fullread.--jsonreturns the same fields. It can't be combined with--ref,--all,--include-hidden,--no-text,--depth,--compactor--max-bytes. See #339.- See what changed after an action -
click,type,key,selectand the other actions that take an automatic screenshot now print what changed on the page: new dialogs, new controls with refs you can use, state changes, removed elements, how much text changed in each part of the page, or a singlenavigated:line. Surf waits up to 2 seconds for the page to settle and says whether it did. Password and payment values are never printed. Change the wait with--settle <ms>orsettleMsinsurf.json(up to 30000), or turn the report off with--no-diff. The old hidden comparison between tworeadcalls made within 5 seconds of each other is gone. See #337.
Fixed
- Native dialogs no longer hang actions - A
click,type,key,jsor other action that opens a nativealert(),confirm()orprompt()now returns as soon as the dialog opens and printsNative <type> dialog is open: "<message>". Close it with dialog.accept or dialog.dismiss.dialog.info,dialog.acceptanddialog.dismissno longer wait for the stuck action to finish, and no automatic screenshot is attempted while the dialog blocks the page. To notice dialogs, page actions now attach Chrome's debugger before they run, so a visible Chrome window may show its debugging banner sooner than before. See #343. - Refs after a re-render - When a page re-renders and replaces the element behind a ref such as
e12, actions on that ref now fail instead of silently acting on the removed element. If exactly one visible element has the same role and name, the error suggests it:Element e12 no longer exists. Did you mean e40 (button "Save")? Otherwise run surf read.See #340. - Cut-off page text is marked - Page text cut at 50,000 characters or at
--max-bytesnow ends with[Truncated: showing N of M bytes. Full text: <path>.]inreadandpage.text, and the full text is saved to a private file.--jsonaddstruncated: { shownBytes, totalBytes, path }. Remote clients and--with-pageprompts get the note without a file path. See #338.