browser4-plugin

Scaffold, implement, and deploy Browser4 plugins using the Maven archetype and PluginMount interfaces.

1.1k|151|Updated Mar 12, 2018
One-click install
npx skills add https://github.com/platonai/Browser4 --skill browser4-plugin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: browser4-plugin
Source: https://github.com/platonai/Browser4/tree/main/skills/browser4-plugin
Command: npx skills add https://github.com/platonai/Browser4 --skill browser4-plugin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Extending Browser4 with custom capabilities — CAPTCHA solving, media processing, content conversion, page-category detection, custom RPA actions, or new LLM agent tools — requires knowing the plugin architecture, mount-point interfaces, manifest format, and deployment process. This Skill guides the full lifecycle from requirements clarification through scaffolding, implementation, testing, and deployment.

Core Features & Use Cases

  • Archetype-Based Scaffolding: Generate a complete plugin project with mvn archetype:generate using the browser4-plugin-archetype, with parameters for mount points, custom tools, and lifecycle hooks.
  • Mount-Point Implementation Guidance: Step-by-step code patterns for BrowseEventMount, LoadEventMount, CrawlEventMount, ToolMount, PageSnifferMount, and the Browser4Plugin lifecycle interface.
  • Troubleshooting & Deployment: A symptom-to-fix table covering common failures (ClassNotFoundException, missing manifests, fat JARs) plus deployment via the plugins/ directory or REST API.
  • Use Case: You want Browser4 to auto-detect CAPTCHA pages and expose a solving tool to LLM agents. Use this Skill to scaffold the plugin, implement BrowseEventMount + ToolMount + PageSnifferMount, build the thin JAR, and deploy it.

Quick Start

Ask the assistant to scaffold a new Browser4 plugin with the Maven archetype, specifying your groupId, artifactId, and which mount points you need.

Frequently Asked Questions about browser4-plugin

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Browser4 plugin from scratch?

Install the PDK parent POM with `mvn -pl browser4-pdk install`, then run `mvn archetype:generate` with the `browser4-plugin-archetype` and parameters like groupId, artifactId, and mountPoints. Build with `mvn package` and deploy the JAR to the server's `plugins/` directory.

Which PluginMount interface should I implement for my Browser4 plugin?

Use BrowseEventMount for automatic per-page logic (key hook: onDocumentSteady), LoadEventMount for URL normalization or HTML parsing, CrawlEventMount for URL filtering, ToolMount for LLM agent tools, and PageSnifferMount for page-category detection. The auto-configuration class can implement several at once.

Why is my Browser4 plugin not loaded at startup?

The most common causes are a missing or malformed `browser4-plugin.json` manifest, the JAR not being in the plugins directory, or `defaultEnabled: false` without an explicit enable override. Enable it with `browser4.plugins.enable=<name>` or `browser4.plugins.enable-all=true`.

Why does my Browser4 plugin throw ClassNotFoundException at runtime?

This happens when `browser4-*` or Spring Boot dependencies use `compile` scope instead of `provided`. The host application already supplies those classes, so only your own code and true third-party libraries should be bundled in the plugin JAR.

When should I not create a Browser4 plugin?

Skip plugin development for simple data extraction from a known site (use the browser4-cli HTML snapshot or X-SQL instead), one-off browser automation (a quick CLI script is faster), or changes to core Browser4 behavior, which belong in the main source tree.

How do I expose a Browser4 plugin feature as an LLM agent tool?

Implement ToolMount in your auto-configuration and return a ToolExecutor extending AbstractToolExecutor, declaring the tool in a toolSpec with domain, method, arguments, and return type. The framework handles coroutine dispatch for tool executors automatically.