Skip to content

v2.0.0

Latest

Choose a tag to compare

@congzhou09 congzhou09 released this 01 Nov 15:36
· 4 commits to main since this release

Breaking changes

  • get_url and get_title are replaced by get_page_info, which returns { url, title }. It answers even while the page is not responding.
  • list_tabs: the field that marks the tab this server acts on is renamed from active to connected. active now marks a tab showing on screen.
  • Positions in results are 1-based, for columns as well as lines, and name the script by url. In 1.4.3, set_breakpoint returned Chrome's raw locations (scriptId, 0-based), and columns elsewhere were 0-based.
  • get_console_logs: entries from before this server connected have no timestamp. In 1.4.3 they carried the time this server connected.

If your client allows tools by name, replace get_url and get_title with get_page_info, and add the new navigate_tab and reload_tab.

New

  • navigate_tab and reload_tab load a URL in the connected tab or reload it, and wait for the load event. If execution pauses first, they return the call stack instead. Both work while paused at a breakpoint. reload_tab can bypass the HTTP cache with ignoreCache.
  • set_breakpoint takes source: a file path as in your project, such as src/App.tsx, mapped through source maps. When that file changes, the breakpoint is dropped, and the next state or navigation result says so.
  • resume_execution takes terminate: true to skip the rest of the paused code, e.g. to stop an endless loop.
  • pause_execution waits up to 2s and returns the call stack. If no script runs in that time, it says the pause is pending.
  • evaluate_js returns the pause position at once when the expression hits a breakpoint. The rest of the expression runs after resume.
  • get_console_logs takes since, to read only the current page load (current-page-load) or to leave out entries from before the connection (earlier-page-load). Entries from before the connection or from an earlier page load carry a from marker.
  • switch_tab says when the tab it switched to is already paused.
  • Pause and step results name the breakpoint that was hit.

Fixes

  • After a reload or navigation ends a pause, the debugger state no longer reports the old page's call stack. Chrome sends no Debugger.resumed in that case.
  • A pause left pending on an idle page, by pause_execution or by DevTools' pause button, no longer stops inside this server's own reads of the page. It waits for the page's own code.
  • Breakpoint IDs are issued by this server. Chrome names a breakpoint by its place, so a breakpoint set at the place of an earlier one got that one's ID. remove_breakpoint returns an error for an unknown ID.
  • Attaching the debugger to a tab: calls made during an attach wait for it. An attach that gets no answer times out instead of hanging. A failed attach is undone, and the next call tries again.
  • switch_tab with a targetId that list_tabs does not return no longer switches tabs or drops the current connection.
  • resume_execution returns a clear error when execution is not paused.
  • get_console_logs keeps entries in the order they arrived.
  • Time-out messages no longer name a breakpoint as a possible cause, since a page paused at a breakpoint still answers CDP commands.

Docs

  • README, Limitations: breakpoints are not shared with DevTools, and DevTools' "Deactivate breakpoints" has no effect while this server debugs the tab.

Full changelog: v1.4.3...v2.0.0