Embedded, on an ordinary pageEverything you are reading is plain HTML. The box below is a full Smalltalk VM running a Pharo application — a Morphic demo with the IDE hidden, inside this page, sharing it with the text, no plugin and no server doing the work.
This page embeds the launcher in an <iframe> and points it at an
image with the hash. That is the whole trick, and it is the route to take if you just
want a working Smalltalk on your page — input, cursor, clipboard, sound and the file
picker come wired:
<iframe src="https://smalltalkjsvm.com.ar/#zip=https://your.site/your-image.zip"
style="width:900px; height:675px; border:0"></iframe>
Swap the URL after #zip= (or #url=) for your
own image. Anything the launcher accepts works here too.
To drive the VM from your own code instead — your own canvas, your own event
handling — talk to the worker directly. That is what the launcher itself does, and
the main page shows the core of it: an OffscreenCanvas handed to
squeak_worker.js, the image's changes and sources written into the
virtual file system first. You take on wiring input and cursor yourself, which is the
price of the extra control.
SmalltalkJsVm is free software (MIT).