monaco
Configurable Monaco (VS Code) code editor. The third sandboxed heavy-JS plugin. Canonical doc is {code, language}; syntax highlighting runs worker-free on the main thread (opaque-origin safe), with an opt-in real-worker path. Supports a diff-editor mode and per-instance language/theme/read-only/minimap/word-wrap config.
v0.1.0-phase0sandboxed iframe
Install and mount
go get github.com/DonaldMurillo/gofastr-plugins@v0.5.0
import "github.com/DonaldMurillo/gofastr-plugins/monaco"
app.RegisterPlugin(monaco.New())Isolation
Runs in an opaque-origin iframe
The frame never gets allow-same-origin, so it cannot reach host cookies, the database, or the host DOM. It talks to the host only over the versioned postMessage bridge, limited to the capabilities listed below.
Manifest
- Plugin version
- 0.1.0-phase0
- Framework compat
- >=0.28.0
- Isolation
- sandbox-iframe-opaque
- Sandbox tokens
- allow-scripts
- Capabilities
- document:read, document:write, theme:read
- Optional capabilities
- none
- CSP additions
- none
- Route prefix
/__gofastr/plugin/monaco- Entry
/__gofastr/plugin/monaco/editor.html- Schema
- monaco-v1
- Min height
- 320px
- Docs
- docs/monaco.md