Browser action

A .ts action that drives the embedded browser — automate any site.

Browser action
Create in Cowork
Cowork Browser
https://status.example.com

System status

API — degraded performance
→ action filed: "Investigate outage"

An action that automates the Cowork desktop shell’s embedded browser through ctx.browser: navigate, read, click, fill — on the pages you are already signed into. It lives in an app folder with no UI, and `requires: ["desktop"]` in its cowork.json says where it can run.

Use this shape for anything that needs a real page — checking a dashboard, scraping a table, filling a form on a cookie-authenticated site. In Cowork: Create → Action → Browser action.

Create it

This template is built into Cowork Studio's Create dialog. Open Manage Workspace, pick the matching tab, click its Add button and choose Browser action — name it, and the files land in your workspace ready to edit.

Code

// .cowork/apps/my-action/cowork.json
{
  "name": "my-action",
  "version": "0.1.0",
  "requires": ["desktop"],
  "actions": { "my-action": "my-action.ts" }
}

// .cowork/apps/my-action/my-action.ts
export default async (args, ctx) => {
  if (!ctx.browser) {
    return { ok: false, reason: 'run this from the Cowork desktop shell' }
  }
  await ctx.browser.navigate('https://example.com')
  const page = await ctx.browser.read()
  return { ok: true, title: page.title }
}