Skip to content

fenwei-dev/bun-webview-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bun.WebView Agent Skills

A collection of skills for AI coding agents working with Bun.WebView — the native headless browser automation API built into Bun.

Available Skills

browser-automation

Guide for browser automation using Bun.WebView. Covers web scraping, screenshot capture, form automation, and programmatic page control.

Use when:

  • "Take a screenshot of a website"
  • "Automate filling this form"
  • "Scrape data from a webpage"
  • "Test my web application"
  • "Click buttons and interact with elements"

Topics covered:

  • Creating WebView instances with new Bun.WebView()
  • Navigation (navigate, goBack, goForward, reload)
  • Element interaction (click, type, press keys)
  • Form automation workflows
  • Data extraction with evaluate()
  • Screenshot capture (PNG, JPEG, WebP)
  • Scrolling (scroll, scrollTo)
  • Chrome backend configuration
  • Console capture and debugging
  • Best practices and complete examples

Installation

Claude Code

cp -r skills/browser-automation ~/.claude/skills/

claude.ai

Add the skill to project knowledge or paste the contents of skills/browser-automation/SKILL.md into your conversation.

Usage

Skills are automatically available once installed. The agent will use them when relevant tasks are detected.

Examples:

Take a screenshot of example.com
Scrape the top 10 stories from Hacker News
Automate logging into this website

Skill Structure

Each skill contains:

  • SKILL.md - Instructions for the agent
  • scripts/ - Helper scripts for automation (optional)
  • references/ - Supporting documentation (optional)
  • evals/ - Evaluation test cases (optional)

Quick Example

await using view = new Bun.WebView({ width: 1280, height: 720 });
await view.navigate("https://example.com");

// Take a screenshot
const screenshot = await view.screenshot();
await Bun.write("example.png", screenshot);

// Extract data
const title = await view.evaluate("document.title");
console.log(title);

// Interact with elements
await view.click("button#submit");
await view.type("Hello World");

About Bun.WebView

Bun.WebView is a native headless browser automation API built into Bun. It provides programmatic control over web browsers for testing, scraping, screenshot capture, and automation tasks.

Key Features:

  • Two Backends: WebKit (macOS default, zero deps) or Chrome (cross-platform)
  • Native Events: All interactions dispatch OS-level events with isTrusted: true
  • Auto-waiting: Selector-based methods wait for elements to be actionable
  • Disposable Pattern: Use await using for automatic cleanup

Learn more at bun.com/reference/bun/WebView

Contributing

To create a new skill:

  1. Create a new folder in skills/{skill-name}/
  2. Add a SKILL.md with instructions for the agent
  3. Optionally add scripts, references, and evaluations
  4. Test the skill thoroughly

See AGENTS.md for detailed guidelines.

License

MIT

About

Browser automation via Bun's built-in Bun.WebView API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors