# Page Agent

> One script tag gives a web page its own GUI agent — no extension, no headless browser, no screenshots

- Category: Agents & Automation / Computer & Browser Use
- Language: TypeScript
- Licence: MIT
- Repository: https://github.com/alibaba/page-agent
- Website: https://alibaba.github.io/page-agent/
- Canonical page: https://ai-tldr.dev/tools/page-agent/

## In short

Page Agent is One script tag gives a web page its own GUI agent — no extension, no headless browser, no screenshots. Page Agent inverts that. It sits in the Computer & Browser Use category of the Agents & Automation tools and is open-source, written in TypeScript and licensed MIT.

## Overview

Most browser agents sit outside the page: a Chrome extension, a Python driver, a headless browser, a stream of screenshots fed to a multimodal model. Page Agent inverts that. It is a JavaScript library that lives inside the web page itself — you add one script tag or one npm import, and the page gains an agent that can operate its own interface in natural language.

Because it works by text-based DOM manipulation rather than screenshots, it needs no multimodal model and no special browser permissions, and it works with most mainstream LLMs including locally deployed ones. You bring your own model and endpoint: the constructor takes a model name, a base URL and an API key, so a page can be driven by Qwen, a hosted OpenAI-compatible provider, or something running on localhost.

For work that leaves a single page, the project ships an optional Chrome extension that extends an agent across browser tabs, and a beta MCP server so an external agent client can control the browser from outside. Alibaba's own framing of the use cases is product-shaped: ship an AI copilot inside a SaaS product without rewriting the backend, collapse a twenty-click ERP or CRM form into one sentence, or make an existing web app reachable by natural language for accessibility.

It is MIT-licensed TypeScript, published to npm as page-agent, with a live demo, full documentation site and a Chrome Web Store listing for the extension. The demo CDN build is wired to a free testing LLM API and is explicitly for technical evaluation only — real deployments supply their own model credentials.

## What it does

- Pure in-page JavaScript — no browser extension, Python runtime or headless browser required for the base case
- Text-based DOM manipulation instead of screenshots, so no multimodal model and no special permissions are needed
- Bring your own LLM: any mainstream model, hosted or local, configured with a base URL and API key
- Optional Chrome extension for tasks that span multiple pages or tabs
- Beta MCP server so an external agent client can drive the browser
- Small bundle, published to npm as page-agent, with a jsDelivr build and a China CDN mirror

## Getting started

There are two routes: a single script tag against the demo build to try it, or an npm install for anything real. Both are taken from the project README.

1. Try it with one script tag

   This build uses the project's free testing LLM API and is for technical evaluation only. Add ?autoInit=false to load the script without creating the demo agent automatically.

```text
<script
    src="https://cdn.jsdelivr.net/npm/page-agent@1.12.4/dist/iife/page-agent.demo.js"
    crossorigin="anonymous"
></script>
```

2. Install it properly

```bash
npm install page-agent
```

3. Point it at your own model

   The constructor takes any OpenAI-compatible endpoint, including a locally deployed model.

```js
import { PageAgent } from 'page-agent'

const agent = new PageAgent({
    model: 'qwen3.5-plus',
    baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
    apiKey: 'YOUR_API_KEY',
    language: 'en-US',
})
```

## When to use it

- Adding an AI copilot to a SaaS product in a few lines, without rewriting the backend
- Turning long form-filling workflows in ERP, CRM or admin systems into a single sentence
- Making an existing web app operable by natural language for accessibility
- Letting an external agent client drive your browser through the beta MCP server
