Starting with beta build 12.10.283300 on October 8, the Telegram for macOS client includes the HTMLBubbles module: messages rendered with HTML and CSS, featuring embedded JavaScript, that reside directly within the chat bubble, without a Mini App window. On October 11, build 13.0.283309 added the three.js library and three 3D games controllable with arrow keys. Currently, this only affects users on the macOS beta channel: the module operates using demo conversations embedded within the build itself, and there is no server-side message type for it in the API schema.

The post on Telegram — @gramnews
HTML messages in Telegram for macOS beta

What the Build Contains

The macOS beta is distributed via the update feed mac-updates.telegram.org, and each build is a standard zip archive containing the application. Build 12.10.283299 does not include the module; in 12.10.283300, the HTMLBubbles_HTMLBubbles.bundle package appears alongside other resources. The build was disassembled on the same day.

Inside the package are twelve .chat files. These are not server data, but rather scripts for demo conversations: a header, a list of participants with avatar colors, and messages, each being an HTML snippet with its own <style> and <script>. The names are self-explanatory regarding their purpose: "Design Crew", "Deploy Bot", "Stress Test", "Playground", "Long Reads", "Trip to Lisbon", "Shop Assistant", "Analytics", "Live Scripts", "Code Review", "Game Night", "Motion Lab". The caption for "Stress Test" explicitly names the engine: "what litehtml can handle and what it cannot".

The executable's strings contain a catalog of demo messages, about fifty cards: a boarding pass with day tabs, a product page with size and color selection, a conversion funnel, cohort retention, a pull request with an Approve button, a CI build with Promote and Roll back buttons, tic-tac-toe against a bot, dice "that actually roll", a music player with a live equalizer, and a reply "that types itself, like AI".

A dedicated bot interlocutor, HTML Bot, introduces itself as follows: each reply is HTML and CSS, no network; type / to select a message. It also provides a rule for custom code: any HTML with styles and a script is displayed full-width without a bubble, while if wrapped in <div class="widget">, it appears inside a bubble.

What the October 11 Build Added

In build 13.0.283309, two items appeared in the package. The first is lib/three.js, weighing 1.27 MB: the three.js library, revision r160, under the MIT license, recompiled "for HTML messages" as per the comment in the file's first line – the module executes as a single script and places itself in the global THREE object. Messages link to it not by a network address, but by an internal app:three reference.

The second is a thirteenth conversation, "3D Lab", with the caption "three.js scenes rendered by the app's Metal renderer". It contains three messages: the arcade game Chicken Cross, where a chicken crosses roads, a "three.js on Metal" demo scene, and chess against a bot. Controls for Chicken Cross are arrow keys or WASD after clicking on the field; Esc releases focus; duplicate buttons for mouse input are provided below the field.

The post on Telegram — @gramnews
three.js and 3D games in Telegram for macOS beta messages

A ported folder also appeared, containing over a hundred separate HTML files – the same demo messages, organized by conversation. The string "twidget has no port of this card" in the binary hints at its purpose: cards are being ported to a second rendering engine to check which ones successfully migrate.

What This Means for Users and Bot Developers

Stable Telegram for macOS, Telegram Desktop, iOS, and Android do not display such messages. In the beta, the module works with its own demo conversations: there's no way to send an HTML message with a script to another user via the server – the API schema (layer 230) lacks a message type that would deliver the raw markup with styles and script to the recipient. Such a type appeared later: on October 23, the messageMediaWidget constructor appeared in the macOS beta schema (layer 233), and on October 26, widgets gained requests to bots.

The closest public feature is Rich Messages, which appeared in Bot API 10.1 on June 11, 2026. A bot can send a message in HTML or Markdown via sendRichMessage, but the documentation describes HTML only as a formatting method: each tag is reduced to a block from a fixed set – paragraph, heading, list, table, quote, collapsible block, formula, photo, video. In the API schema, this is evident from the types: inputRichMessageHTML with a markup string is accepted as input, and the recipient sees richMessage with a list of blocks – the same ones used to assemble Instant View pages. Neither <script> nor <style> tags are listed among those supported by the Bot API.

The build does not show any connection between HTMLBubbles and Rich Messages: demo conversations are loaded from a package within the application, not from server messages. The demo texts are hardcoded in English in the binary and are not present on the macOS translation platform.

How a Message is Rendered in the Bubble

The primary method avoids using a browser. The markup is parsed by litehtml – an open-source HTML and CSS layout engine under the BSD license, which itself does not render anything: it arranges elements by coordinates and delegates rendering to the application. It reads HTML using the Gumbo parser, and Gumbo's debug strings ("Entering adoption agency algorithm", "Noah's ark clause") were included in the binary along with it. The application handles rendering itself, and HTML Bot's strings contain three comparison modes: litehtml, litehtml-gpu – the same layout rendered via Metal – and twidget (WebKit).

A script in such a message does not directly modify the markup. It declares a render() function that returns an HTML string for the current state, and handlers: onAction(name, value) for clicks on elements with a data-action attribute, onKey, onPointer, and onFocus for games. After each event, the client calls render() and redraws the bubble in place. On top of this is a set of animation helpers: tween(), animate(), ease.* curves, transition('pop') for native content changes. Static HTML around <script> serves as a fallback if the script fails to run.

According to the "Live Scripts" demo text, each script runs in its own JavaScriptCore sandbox – the JavaScript engine included with macOS. Right-clicking a card opens "Script Log…" with its console, and the /stats command in the chat with HTML Bot enables per-message frame rendering time, frame rate, CPU, and memory display – a measurement tool, not for the user.

Sandbox and Network

The "Runaway scripts the sandbox stops" demo illustrates the limits directly within the cards: an infinite loop on load, according to their text, is interrupted by JavaScriptCore after 50 ms, leaving the static HTML; a card with a Hang button launches a similar loop inside onAction; a timer that occupies the CPU for 40 ms every 100 ms exceeds the 200 ms CPU time budget per second.

The WebKit mode resides in a separate WidgetSandbox module and is isolated from the network by three layers simultaneously. The page receives a content security policy with connect-src 'none' and scripts only via a one-time key; a list of rules is attached to WebView that blocks all http, https, ws, wss, and ftp addresses; before the message code, fetch, XMLHttpRequest, WebSocket, EventSource, RTCPeerConnection, workers, and window.open are removed from the window. Images and media are only allowed from data: and blob:, and files like three.js are served by an internal scheme handler.

How 3D Scenes Are Structured

The games from "3D Lab" are written with standard three.js code: a scene, an orthographic camera, light with shadows, and cube geometry. The renderer is created as THREE.WebGLRenderer, but with a cornerRadius parameter that three.js does not have – it is only understood by the application's wrapper. The binary contains a wrapper for the WebKit page mode: it replaces WebGLRenderer with a descendant, inserts its canvas into an element with the data-3d attribute, monitors its size, and passes arrow keys, WASD, space, and Enter to the game's onKey – with Cmd, Ctrl, or Alt, keys are sent to the application.

In the bubble, according to the conversation's caption, the same scene is rendered by the application's Metal renderer; the module contains HTMLBubbleGPU and HTMLBubbleGPUPool classes and buffers for Metal resources. On Macs without Metal, the game displays a placeholder: "3D needs a Mac with Metal".

Telegram Serverless and tgcloud.ai

Neither the HTMLBubbles package, nor the binary's strings, nor the API schema contain links to Telegram Serverless, tgcloud.ai, or any other server-side executor: demo messages are stored locally, and HTML Bot has no network by design. Any connection between them is currently unconfirmed by anything other than a temporal coincidence.