christopherwoodall

A Blog

digital musings.

2 January 2026

Browser Agent

tags: agents - browser

Anthropic recently released Claude in Chrome and as a Firefox user I was a bit jealous. But here we turn those feelings into action, so we put Claude to work writing a simple browser agent that works in Firefox.

Download it here


Setup

WARNING: This isn’t safe or production ready. Just a demonstration. Use at your own risk.

  1. Install Tampermonkey or a similar userscript manager.

  2. Create a new userscript and copy the code from this gist.

Browser Agent Tampermonkey

  1. Click the robot emoji(🤖) in the bottom right corner of any webpage to activate the agent.

Browser Agent Icon

  1. Click the “Settings” button to configure your API key and model.

Browser Agent Setup

  1. Head over to the “Chat” tab and enter a message to get started!

Review

The model and prompt really make a difference here.

The agent runs a simple ReACT loop allowing it to operate in cycles. It can call tools(like executing javascript) if the messages are formatted correctly.

Agent ReACT Loop

We instruct the agent on the format for tool use in the system prompt, but it is up to the model to follow those recommendations. We can see here how strict the extraction logic is.

Agent Tool Use

Tool execution is pretty risky. In the example below there are no guards preventing the agent from running dangerous or injected code.

Agent Dangerous Tool Use

Despite all of that the agents still manages to do pretty well at some tasks - like finding posts or clicking on links. Though have no issues hallucinating or making mistakes.


Unofficial Benchmark

A lot of this really does come down to good prompt engineering and model selection. Going from a just a few releases ago to something newer was a big step up in capability and reliability.

For the sake of sciene I decided to ask a few models to reimagine my blog as if they were drunk. Below are the results.

OpenAI GPT-5.2

Anthropic Claude Opus 4.5

Claude Opus 4.5 Intoxicated Bench

Google Gemini 3 Pro

Gemini 3 Pro Intoxicated Bench

Anthropic Grok 4.1 Fast

Grok 4.1 Fast Intoxicated Bench

DeepSeek DeepSeek V3.2

DeepSeek V3.2 Intoxicated Bench