SDK · Embedding
Configure an embed, and watch it change
The editor beside these controls is running right now, configured by them. Change a role, withhold a capability, take a chrome region away or give it a brand colour, and it becomes the thing you configured — then copy the configuration that reproduces exactly what is on screen.
- 5 roles
- 9 capabilities
- 25 chrome regions
- 18 brand tokens
The live editor
- —
- — of 9 capabilities
- — of 25 regions shown
What the frame is given
- Chrome withheld
- —
- Frame sandbox
- —
The editor holds a WebAssembly instance of roughly 100 MB and is booting now. The readout above is already live: it is resolved from the same authority the editor resolves.
The configuration this produces
Both panels are rewritten on every change, and between them they are the
whole of what a host writes. The element takes
8 attributes, and everything
configured above has one: mode names the role,
can withholds capabilities and chrome withholds
regions. Both lists only ever narrow — nothing here can hand a
role something it was not given, which is the property the whole model
rests on. The element writes them into the frame's URL before its first
navigation, so the same decisions are also expressible as the parameters
autosave mode can chrome prefs granted participant room for a
host with no package at all.
node webapp/tools/build-brand.mjs
A colour that fails WCAG AA is refused by that command, naming the pair, the measured ratio, the floor and the nearest value on the same hue that would pass — not corrected, because a product shipped in an accent nobody approved is a lie a host discovers from a screenshot, and not warned about, because a warning in a build log is ONLYOFFICE's nag-modal in a different font. The floors are WCAG's own split: 4.5:1 for text, 3:1 for edges and icons. The refusal beside the Brand controls is produced by the same code that command runs, in this page, so it cannot describe a message the generator no longer emits.
The rules these controls follow
Nothing here is gated. ONLYOFFICE puts host customization behind
a licence check in code — LayoutManager._applyCustomization
returns early when !_licensed — so an integrator ships
their chrome and then discovers the modal. This is Apache-2.0, the
permissive licence is the whole point of the project, and gating the
one thing that makes it worth embedding would surrender it.
A capability list narrows; it never widens. All 9 are withheld independently — “comments only, everything else off” is a configuration, not a rung on a ladder — but a list can only take away from what the role granted, so there is exactly one direction to audit.
A region is not a capability. Withholding a region is a decision
about your page; withholding a capability is a permission. That is why
preview and readonly are different
presentations rather than one with print turned off, and why the region
list narrows the same way the capability list does.
A palette is a stylesheet. The brand fields apply to the running editor with no reload, because a white-labelled build is one swapped stylesheet. Everything else here is resolved before the frame's first navigation, so it remounts instead.
What this page does not do yet
- Role, capability and region changes remount the frame. They are resolved before the first paint on purpose, so there is no way to apply one to a running editor without reloading it — and a channel that could would be a window in which the editor was something else. The brand controls do apply live, because a palette is a stylesheet.
-
The brand preview is this page applying the generated stylesheet to
the frame. A real white-labelled deployment commits what
build-brand.mjswrites and serves it; nothing here can write a file. The CSS in the panel above is the generator's own output, byte for byte. -
Two strips survive a container that was offered no region, and
this page is how they were found. In
previewthe top bar still carries the document-state chip, the import-findings count and the Properties button, and the Viewing banner still offers “Switch to editing” — which apreviewcontainer can never do. Neither belongs to any of the 25 regions, so neither can be withheld; deciding where they belong is a change to the region set rather than to this page, and it is filed rather than quietly patched. -
One document, and no host commands. The frame opens the shipped
sample. For driving the editor over both transports — in-process and
postMessage— with every command the registry offers, the two-panel host demo is embed.html.
The reference for all of it is Embed the editor: the capability table, the region table, the host contract, the refusal codes, and the tests that hold each claim up.