Module 8 · Embedding

Signed off 26-10-2026 · frozenUpdated 26-10-2026

Definition and examples

How another site places the calculator in its own page: an iframe of the embedded page, or one script tag that inserts it. Example: Burundi's trade portal on eRegulations v7 shows the calculator on its /Tariffs page, in French, in the portal's colours, with no header or footer of ours.

Functions

The embedded page

  1. Address: the installation's /embed, with the form, the result and the notices; no header, footer or embed offer.
  2. Host's choices: colours as hex codes, logo on or off, language, passed in the address; nothing else D9.
  3. Links: documents and printing open in a new tab, never inside the host's frame.

The script tag

  1. One line: <script src="../.../embed.js" data-lang="fr"> inserts the iframe where it stands.
  2. Height: the page tells the host its height as it changes; the frame grows and shrinks, and never scrolls inside itself.

Allowed sites

  1. List: each installation lists the sites allowed to embed it, on the administration page (module 7).
  2. Enforced by the browser: the embedded page announces the list in frame-ancestors; every other page announces 'none'.
  3. Offer: the public page gives the one-line code to copy (module 0).

eRegulations v7

  1. The change, after pilot 1: when a v7 setting names the calculator, /Tariffs renders the script tag; otherwise today's page (concept note §5). Where the host's menu places it is the host's: for Burundi, the same place in French and English (ERN-1239).

Module 0 · Module 7 · Module 10 · Concept note §5 · Dictionary: embedding, frame-ancestors, CORS

Rules

  • The host cannot change a figure, a notice or the source line; it chooses only colours, logo and language.
  • Height messages go to the allowed site only, and carry nothing but a number.
  • The embedded page reads nothing of the host's page, and sets no cookie the host could see.
  • The API answers the calculator's own pages only, since the embedded page is one of them; the prototype answered every site.
  • The embedded page stays under 100 KB of script and styles, compressed; a build that breaks the budget fails D42.

Decisions needed

None. ?30 was answered on 30-09-2026: D42.

Sources

  • The concept note, frozen 30-09-2026, §5; decision D9.
  • The prototype's ?embed=1 and server.js headers; v7's ?embed=true and _EmbeddedLayout.cshtml.
  • Not seen: Burundi's portal page as it would host the script; the portal's content security policy.
Drafted with Claude for melux · UNCTAD · working material, hidden from search enginesUpdated · 26-10-2026