Skip to content

Plugin System

Plugins are small modules built on top of the core CDP and DOM capabilities. They usually accept a view object plus options, then return a controller with stop() or similar lifecycle methods.

  1. Enable the CDP domains the plugin needs.
  2. Register listeners on the view.
  3. Inject a small helper script or use CDP events.
  4. Return a controller that can tear everything down cleanly.
  • Narrow responsibility.
  • Clear setup and shutdown behavior.
  • Minimal assumptions about the host page.
  • A typed controller or service API.

When one plugin needs to signal another, prefer host-side plugin messaging instead of in-page browser events. Use the shared message bus (plugins/shared/plugin-message-bus.ts) and topic-based messages so plugins stay optional and independently removable.