Running it unattended

Opening the page so a visitor cannot leave it

You do not need a special "kiosk browser". Edge and Chrome are already on every Windows machine and will do it. PromethistLinkPixelStreaming/Samples/Examples/start_kiosk_window.ps1 is our implementation of everything below; run that — through tablet.bat, see below — rather than assembling it yourself, and read this to understand what it does.

Use --kiosk, and place the window yourself. Everyone gets this wrong in one direction or the other:

--app= plus --start-fullscreen respects the monitor you name, but the window keeps a Chromium-drawn title bar that fullscreen only auto-hides. Touch the top edge of the glass and it slides back down, with minimise and close on it — on a screen whose entire purpose is that a visitor cannot get out of the page. Because it is drawn inside the client area, no Win32 trick removes it.

--kiosk has no such bar at all, and additionally disables the fullscreen toolbar reveal, ESC and Ctrl+W. Its one flaw is placement: it opens on the primary display and discards --window-position. So do not ask it — put the window where you want with SetWindowPos after launch. Once placement is yours, kiosk mode costs nothing.

msedge.exe --kiosk "http://127.0.0.1:8080/"
           --user-data-dir="%LOCALAPPDATA%\KioskTablet"
           --no-first-run --noerrdialogs --disable-session-crashed-bubble
           --disable-pinch --overscroll-history-navigation=0

Call SetWindowPos(hwnd, HWND_TOPMOST, x, y, w, h, SWP_NOACTIVATE | SWP_SHOWWINDOW) on the browser’s window once it appears.

Four details that each cost an afternoon if you skip them:

  • --user-data-dir is not optional. Without a profile of its own, a second launch simply hands the URL to the already-running browser and silently ignores everything else you asked for.

  • Ask Windows where the monitor is; never hardcode coordinates. A display placed to the left of the main one has negative coordinates, and anyone can rearrange them in Display Settings.

  • --disable-session-crashed-bubble, or every power cut leaves a "Restore pages?" bubble sitting on the tablet with nobody to dismiss it.

  • SWP_NOACTIVATE, and SW_SHOWNOACTIVATE if you restore the window. On a one-PC installation, Unreal is fullscreen on the other display. Taking the foreground from a fullscreen D3D window is a good way to make it minimise itself.

Then keep watching the window. Closing it kills the process and a supervisor brings it back, but minimising it does not. The process stays perfectly healthy behind a black touchscreen, and every health check on the box still reads green. A one-second loop that restores and re-places the window turns this outage into a flicker. Ours does this; if you write your own, do not skip it.

The browser cannot lock down the machine around it, so change a few Windows settings on a real kiosk: taskbar off the touchscreen, edge swipes off, notification toasts off, screensaver and sleep off. kiosk-24-7-setup.bat, in the same Samples/Examples folder, applies the set we use. Run it once on each kiosk machine, signed in as the account the kiosk runs under; it asks for administrator rights itself, and the settings survive reboots. kiosk-24-7-revert.bat beside it undoes them.

Read its comments first — it goes further than the list above. It switches off Windows' overnight maintenance and scheduled virus scans (real-time protection stays on), sets Windows Update to notify only — so installing updates becomes your job — and stops USB power saving from suspending the touchscreen, microphone or camera. It also excludes our application folder, E:\Streaming, from real-time scanning; change that line to your own folder.

The page itself must also declare <meta name="google" content="notranslate">. Otherwise, Edge offers to translate the kiosk via a corner bubble that a visitor cannot be expected to dismiss, and the browser flag disabling Chromium’s translate does not reach Edge’s own.

Running ours: tablet.bat

tablet.bat, beside the script, is the file you run. Point your supervisor at it with no arguments, or double-click it to try it. It has no restart loop of its own: it waits until the browser closes, and the supervisor starts it again.

The three settings at its top are all there is to configure:

set "TABLET_URL=http://127.0.0.1:8080/"
set "MONITOR=secondary"
set "TABLET_TOKEN=promethist-kiosk-default"
  • TABLET_URL is the machine serving the page: 127.0.0.1 when Unreal runs on this machine, the Unreal PC’s address when it does not. The tablet works out its control channel from the page’s own address, so this one value is all that points it at the right machine.

  • MONITOR is secondary when this machine also drives the big screen, so the touchscreen is its second display, and primary when this machine is the tablet — a mini-PC with one screen. The display is looked up at every launch.

  • TABLET_TOKEN must match AuthToken on the Unreal machine. Both ship with the same value, so nothing needs changing to get running — but read when to replace it. It travels as a URL fragment, #token=…, which a browser never sends to a server.

Shape TABLET_URL MONITOR

A

no tablet — do not run it

—

B

http://127.0.0.1:8080/

secondary

C

http://<Unreal PC’s LAN address>:8080/, on the mini-PC

primary

D

two copies on the one mini-PC. The tablet’s points at the address that reaches Unreal’s 8080 from there; the big screen’s points at the streaming player’s page

tablet secondary, player primary

E

on each box, that box’s page: the tablet’s or the player’s

primary

The two copies in D do not share a browser. Each browser profile is named after its MONITOR (%LOCALAPPDATA%\PromethistKiosk\<monitor>), so the second window cannot be swallowed by the first. In the player’s copy, empty TABLET_TOKEN: that token belongs to the tablet, and the player page has no use for it. In D and E the tablet’s page usually arrives through a tunnel or proxy, so also set url in its tabletConfig.json.

If kiosk mode will not stay on the chosen display, the script says so in its log and relaunches once in the older fullscreen mode — whose title bar can be pulled down from the top edge — rather than fighting the browser forever. -WindowMode fullscreen, added to the start_kiosk_window.ps1 line in tablet.bat, forces that mode by hand.

When the touchscreen stays blank

Read the launcher’s log — under Watchdog, the tablet app’s app.out.log (see Logs). The launcher never gives up: it waits, says what it is waiting for, and carries on by itself once the cause clears.

The log says Meaning

nothing listening on …

Unreal is not running yet, or not serving on that port

port … is open but the page is not servable yet

Unreal is up but has no page to serve: the level is still loading, or WebRoot is missing or empty

… is FILTERED (SYN dropped)

a firewall, not a slow start. Make the inbound rule a port rule that applies to every network profile

Display '…' is not present

the touchscreen is not connected, or MONITOR names a display this machine does not have

Freeing the touchscreen for maintenance

Stop the tablet app in your supervisor. It stays stopped until you start it again. A browser you open yourself is not supervised, so nothing will touch it.

Give both displays the same scaling

On a one-PC kiosk, set both displays to the same scale in Windows' display settings; 100% is the sane default. With mixed scaling the window lands in the wrong place. If you truly need mixed scaling, -ForceScale1 on the same line is the escape hatch, at a cost: the page then renders at one device pixel per pixel, which looks visibly smaller on a high-DPI screen.