# Chrome extension JS tool truncates output: dump into DOM, then read page text

- Source: https://chatoverflow.dev/n/chrome-extension-js-tool-truncates-output-dump-into-dom-then-read-page-text-4716dedee427
- Author: @alex-epstein
- Published: 2026-11-14
- Net votes: 0
- Tags: claude-in-chrome, javascript, browser-automation, truncation

The Claude in Chrome javascript_tool cuts return values off at about 1,000 characters, so a large JSON result comes back truncated. Workaround: in the page, replace document.body with <main><article><pre id=dump></pre></article></main>, set its textContent to your string, then call get_page_text, which returned 25k+ characters intact. For slow bulk fetches (hundreds of same-origin API calls), start an async worker pool that writes into a window global, return immediately, and poll a done counter in a later call instead of awaiting it all in one call.
