Skip to content

v2.21.0

Choose a tag to compare

@nicobailon nicobailon released this 27 Sep 13:30
· 50 commits to main since this release

Surf 2.21.0 makes everyday browser actions faster and makes page reading more reliable. Clicks, typing, scrolling, and js now return as soon as the action is done instead of waiting for a screenshot. After you switch into an iframe, reading the page reads that iframe, and js refuses to run in the wrong frame instead of quietly running in the main page. page.read can now list the whole page, including hidden elements, and no longer fails on very long pages.

Highlights

  • Clicks, typing, scrolling, and js return faster because they no longer wait for the automatic screenshot.
  • Reading a page after frame.switch now reads the frame you picked, and js refuses to run in the wrong frame.
  • page.read --all now lists the whole page, and --include-hidden also shows hidden elements.
  • Very long pages no longer make page.read fail. You get the start of the tree and a file with the rest.

Need to know

If you connect to a Surf host remotely, upgrade the client along with the host, or pass --no-screenshot to js. The new host rejects the js request that older clients send.

Changelog

Highlights

  • Clicks, typing, scrolling, and js return faster because they no longer wait for the automatic screenshot.
  • Reading a page after frame.switch now reads the frame you picked, and js refuses to run in the wrong frame.
  • page.read --all now lists the whole page, and --include-hidden also shows hidden elements.
  • Very long pages no longer make page.read fail. You get the start of the tree and a file with the rest.

Added

  • page.read --include-hidden - Also lists hidden and aria-hidden elements. It implies --all. The Pi surf_read tool accepts the same option as includeHidden.

Fixed

  • Faster actions - click, type, scroll, and other actions that take an automatic screenshot now reply as soon as the action is done, instead of waiting about 0.75 s (up to 5 s when the window is hidden). The reply reads Screenshot (pending): <path>, and the file appears there a moment later. The next command on the same tab waits for it. If the capture fails, no file is written and the host log records why. Remote clients still get the screenshot before the reply. See #328.
  • Faster js - js no longer takes an automatic screenshot, which saves about 0.75 s. Its output never showed that screenshot. Remote clients from earlier releases must upgrade or pass --no-screenshot to js, because the new host rejects their old request. See #325.
  • Selected frame - After frame.switch, page.text and page.state read the selected frame, including out-of-process iframes the extension can reach. js in a selected frame now fails with UNSUPPORTED_FRAME_EXECUTION and tells you to run frame.main first, instead of quietly running in the main page. See #319.
  • page.read --all - Lists every visible element on the page, including offscreen ones. Before, the flag was ignored. See #322.
  • Long pages - page.read no longer fails when the tree is over 50,000 characters. It shows the first 50,000 bytes and ends with a note giving the path of a private file with the full tree. --max-bytes now limits the tree as well as the text.
  • Large responses - Large responses with no file paths in them no longer fail with "response exceeds path rewrite limits". See #322.

Thanks to @tryingET for #319, #322, and #325.