---
title: "Read one stylesheet's or script's text"
method: POST
path: "/v1/browser/source"
tags: ["Browser"]
---

# Read one stylesheet's or script's text

`POST /v1/browser/source`

## Request

- Base URL: `http://localhost:9998`
- URL: `http://localhost:9998/v1/browser/source`
- Auth: HTTP bearer

The browser_source_get tool's mirror. Names the source by id or url and answers a window of its lines, or of one original file from its source map. Read-only.

## Request body

- object
  - `id` string: A source id from /v1/browser/sources
  - `url` string: A source URL (alternative to id)
  - `startLine` integer
  - `lineCount` integer
  - `original` string: An original file from the source's source map

## Response `200`

The lines

- object
  - `id` string, required
  - `kind` string, required
  - `totalLines` integer, required
  - `startLine` integer, required
  - `endLine` integer, required
  - `text` string, required
  - `truncated` boolean, required

## Other responses

- `400`: The source could not be named or read
- `409`: The route needs a live page session. Two types share this status and both clear the same way, by connecting: `not_connected` when nothing is attached at all, and `page_not_attached` when the browser is alive but its page session is not — Chrome closed the tab or detached the inspector, which parks the connection at browser level rather than tearing it down. Both carry `remedy` (`browser_connect action:connect`) and `remedyPath` (`POST /v1/browser/connect`). Branch on `error.type`, never on the 409 alone; the other 409s on browser routes (`conflict`, `dialog_pending`, `browser_consent_required`, `target_leased`, `instance_unknown`, `resource_admission_full`) must not be retried, and one of them mints a second OS consent prompt per attempt.

---

[API](https://skmtc.dev/modelpiper/apis/toolpiper-api.md) · [All operations](https://skmtc.dev/modelpiper/apis/toolpiper-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelpiper/apis/toolpiper-api/revisions/6722bf56385c?raw)
