<div dir="ltr"><font face="verdana, sans-serif">Nothing major but I thought I would be cool to share :)<br><br>As some of you already know, Greenfield can run remote Wayland applications from different hosts. But as of recently, it can do more as well.<br><br>Run applications directly inside the user's browser.<br><br>This can be done using a Web worker. A Web Worker is essentially a stand-alone thread/process in your browser, completely separate from the main thread. Running applications in a Web Worker isolates client code without impacting the performance of the compositor and provides isolation from malicious clients.<br><br>Greenfield supports web applications. There are however some prerequisites.<br><br>- Web applications must be written in JavaScript (or WebAsembly) so they can run in a Web Worker.<br>- A Web application must render it's content to an ArrayBuffer as Web Workers do not have access to the DOM and as such can not use HTML to render their content.<br>- Alternatively web applications can render to an off-screen WebGL accelerated HTML5 canvas. Unfortunately this is still an experimental HTML5 spec.<br>- A Web application must communicate with the compositor using a custom Wayland buffer protocol.<br><br>A Wayland Web application can run directly inside the browser without the drawbacks of network latency or server load, while still being able to interop (copy/paste & drag'n drop) with native server-side applications running directly next to it.<br><br>There are currently 2 small demo web clients available in the Greenfield repository that you can check out: <a href="https://github.com/udevbe/greenfield/tree/master/demo-web-clients" target="_blank">https://github.com/udevbe/greenfield/tree/master/demo-web-clients</a><br><br>simple-web-shm. Based on weston-simple-shm. Draws psychedelic cirkels. Uses array buffers as shared memory between the compositor and the client. Supported on Firefox and Chrome.<br>simple-web-gl. Draws a rotating square. Uses offscreen WebGL and streams it's updates to the compositor using HTML5 ImageBitmaps. Only supported on Chrome.<br><br>tl;dr Run JavaScript Wayland applications directly in your browser: <a href="https://preview.greenfield.app" target="_blank">https://preview.greenfield.app</a></font><div dir="ltr"><font face="verdana, sans-serif"><br></font></div><div dir="ltr"><font face="verdana, sans-serif">cheers,<br></font><div><font face="verdana, sans-serif"><br></font></div><div><font face="verdana, sans-serif">Erik</font></div><div><br></div></div></div>