Web Browser / Kiosk Mode with Torizon OS
If you are looking for information on how to use web browser on Linux and/or how to use Yocto to build an embedded Linux image with web browser, refer to How to Use Web Browser (Linux).
Introduction
This article provides reference documentation to the Chromium Web Browser on Torizon OS.
A common use-case for the Chromium container is to build user-facing applications in web frameworks such as Node, Angular, Ruby on Rails, React etc.
Chromium runs in container runs on top of an existing Wayland session using the Wayland Ozone implementation. In Torizon OS, the recommended way to start a Wayland session is to use the provided Weston container.
Technical Details
iMX8-based SoCs
Chromium version 117.0.5938.132
is the currently supported release for iMX8-based SoCs, with patches from meta-imx.
GPU acceleration is supported via WebGL1 and WebGL 2.
Video decoding is supported via V4L2.
Running Chromium
The following command will launch the browser with the default options and open the WWW CERN Project page.
# docker run -d --name=chromium \
-v /tmp:/tmp -v /var/run/dbus:/var/run/dbus \
-v /dev:/dev --device-cgroup-rule="c 199:* rmw" \
--device-cgroup-rule="c 81:* rmw" --device-cgroup-rule="c 234:* rmw" \
--device-cgroup-rule="c 253:* rmw" --device-cgroup-rule="c 226:* rmw" \
--device-cgroup-rule="c 235:* rmw" \
--security-opt seccomp=unconfined --shm-size 256mb \
torizon/chromium-imx8:4 \
--virtual-keyboard http://info.cern.ch/hypertext/WWW/TheProject.html
Optional command line flags
There are four optional convenience flags when starting the Chromium container.
Two of these flags are purely for backwards compatibility with Torizon OS 6:
--window-mode
: launches Chromium with--start-maximized --app=
--browser-mode
: launcher Chromium with--start-maximized
These are not recommended for use in new deployments.
The other two flags are:
--virtual-keyboard
: adds a virtual keyboard from a local extension. Functionality of this extension has not been tested in Torizon OS 7.--dry-run
: instead of launching Chromium, it just echoes the final command line. This is used for testing.
It's possible to pass arbitrary switches to Chromium by issuing them in any order, together with the known start-up flags. Note that there isn't an official list of switches, neither maintained by Toradex nor by the Chromium team. Users may refer (and test) to a unofficial but widely used list.
Moreover, the positional argument - after all flags - is a URL that defaults to www.toradex.cn
.
Note on Performance
It's highly recommended to not take project decisions with performance baselines taken from WebGL benchmarks or similar. Using such a high-level application to render applications implies more layers of abstraction from the hardware, which may not achieve the same performance of a highly-tuned native graphical application, for example.
Thus, we highly recommend customers to run trials on Chromium with minimal applications of their framework of choosing before commiting to this particular stack.