Can a message run JavaScript?Scripts+
Yes, in a sandbox. litehtml itself never runs scripts; a message's
<script> runs in its own JavaScriptCore context with no network and no DOM. All it can do is return HTML from
render() and react to clicks in
onAction.
Was this helpful?π 41π 2
How does this accordion work?Scripts+
Every question has
data-action="open". A click calls
onAction('open', id); the script keeps a single
openId, so opening one answer closes the other, calls
transition('slide-down'), and
render() returns the new HTML for this same bubble.
Was this helpful?π 28π 1
Do styles from one message leak into another?Rendering+
Never. Each bubble is a separate litehtml document with its own stylesheet list, so a
<style>p { color: red }</style> only affects its own bubble.
Was this helpful?π 19π 0
How long can a message be?Rendering+
There is no hard limit. The article above carries around 20 KB of HTML; the leaderboard in βAnalyticsβ has fifty table rows. Layout cost grows roughly linearly with the number of words and boxes, and a script may return up to 256 KB per render.
Was this helpful?π 12π 3
Can I write my own messages like these?Authoring+
Yes β paste HTML into the composer, with
<style> and
<script> if you like, or edit the
.chat files in
Resources/chats. Anything you send shows fullsize; wrap it in
<div class="widget"> to show it inside a bubble.
Was this helpful?π 33π 1
What stops a script from freezing the app?Scripts+
Every call into a script is capped at 50 ms, and a message gets at most 200 ms of CPU per second. Break either rule and the script is stopped; the card keeps its last HTML and offers a Restart link.
Was this helpful?π 25π 0
Which CSS can't litehtml draw?Rendering+
No transitions, transforms,
opacity,
box-shadow or grid. Scripts animate with what is left β
rgba() colours, margins, sizes and absolute positions β re-rendering up to 60 times a second.
Was this helpful?π 17π 2
Do animations run while I scroll away?Scripts+
No. Timers and frames pause while a bubble is off screen and catch up when it comes back, so a long chat full of live cards costs nothing.
Was this helpful?π 14π 1
Nothing here yet.