A content script is JavaScript that gets injected into a page at runtime. It runs in the same environment as the page, so it can use React hooks, read from the database, and call RPC methods. Content scripts target views by type, so you can inject into specific views or useDocumentation Index
Fetch the complete documentation index at: https://zenbulabs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
"*" to inject into all of them.
Use cases
- Add UI that appears on every page, like a devtools panel or a chat overlay.
- Add UI to a specific page without modifying that page’s source code.
- Let a plugin contribute visible elements to the host app.
Registering a content script
Callthis.injectContentScript(...) from a service:
| Field | Meaning |
|---|---|
view | The view type to inject into. Pass "*" to inject into every view. |
modulePath | Path to the script. Relative paths resolve against the plugin’s directory; absolute paths are accepted as an escape hatch. |
this.setup() ensures cleanup on hot reload.
Authoring a content script
A content script is a module that runs when the page loads. It can mount its own React tree into the DOM. This example adds a toolbar using a shadow root to keep its styles separate from the host page:src/content/toolbar.tsx

