---
title: "Evaluate JavaScript in tab"
method: POST
path: "/tabs/{tabId}/evaluate"
tags: ["Interaction"]
---

# Evaluate JavaScript in tab

`POST /tabs/{tabId}/evaluate`

Runs arbitrary JS in the page context and returns the result.

## Path parameters

- `tabId` string, required

## Request body

- object
  - `userId` string, required
  - `expression` string, required — JavaScript expression to evaluate.

## Response `200`

Evaluation result.

- object
  - `ok` boolean
  - `result` unknown

## Other responses

- `400` — Bad request.
- `404` — Tab not found.
- `409` — Page navigated while evaluating; caller should retry once the page settles.
- `503` — Browser session expired; caller should retry to get a fresh session.

## Changes

- **2026-07-30** `2e41517135ab` — 2 info
  - added the non-success response with the status `409`
  - added the non-success response with the status `503`

[Change history](https://skmtc.dev/jo-inc/apis/camofox-browser/changes/tabs/:tabId/evaluate/post.md)

---

[API](https://skmtc.dev/jo-inc/apis/camofox-browser.md) · [All operations](https://skmtc.dev/jo-inc/apis/camofox-browser/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/jo-inc/camofox-browser/revisions/d007e73dad3d/schema)
