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.
Common pattern
Section titled “Common pattern”- Enable the CDP domains the plugin needs.
- Register listeners on the view.
- Inject a small helper script or use CDP events.
- Return a controller that can tear everything down cleanly.
What makes a good plugin
Section titled “What makes a good plugin”- Narrow responsibility.
- Clear setup and shutdown behavior.
- Minimal assumptions about the host page.
- A typed controller or service API.
Cross-plugin coordination
Section titled “Cross-plugin coordination”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.