Add Chromium as an opt-in browser engine - #120
Open
aaronmayeux wants to merge 5 commits into
Open
aaronmayeux wants to merge 5 commits into
aaronmayeux wants to merge 5 commits into
Conversation
Adds a backward-compatible `browser: luakit|chromium` option (default luakit, so existing setups are unchanged). Validated on x86_64 / Intel Iris Xe, where luakit's WebKitGTK ThreadedCompositor hard-hangs the GPU (live i915 GPU HANG in dmesg) while chromium composites cleanly. - config.yaml: `browser` in options + schema (list(luakit|chromium)) - run.sh: conditional BROWSER/BROWSER_FLAGS; parameterized watch-loop process match for chromium's path-prefixed cmdline; first-run/sign-in suppression via a managed policy (BrowserSignin:0) + --no-first-run - Dockerfile: opt-in BUILD_BROWSER=chromium build-arg to bake chromium at build time (default no-op; the luakit image is byte-unchanged). Arch-available for aarch64/armv7/x86/x86_64 (not armhf/i386) - rest_server.py: per-browser navigate/refresh -- chromium drives CDP Page.navigate/reload so launch_url/refresh_browser work for both - cdp_auth.py: hands-off auth helper -- injects a session token over the DevTools port so the kiosk lands authenticated (form-fill fallback for non-trusted_networks setups is a TODO) - kiosk_overlay.py: in-page back-to-dashboard button injected into kiosk-out pages (works on external pages too; composited, no X overlay)
Adds a Browser option entry and a Chromium Browser Engine section to the README (rationale, CDP control, the two helper daemons, the trusted_networks auth requirement, and the not-yet-implemented form-fill fallback), a CHANGELOG entry, and a config-UI description in translations/en.yaml.
Chromium shipped with the onscreen keyboard structurally broken: tapping a web text field (e.g. Google Maps/Earth search) would not raise Onboard, so users could not type. Root cause was two coordinated bugs, both fixed here and both gated on `browser=chromium && onscreen_keyboard=true` so luakit users and keyboard-off kiosks (e.g. low-end Pis) are unaffected: 1. run.sh exported NO_AT_BRIDGE=1 unconditionally. That was added for luakit/GTK stability, but it kills the AT-SPI bridge Onboard listens on for text-field focus events. Now unset only under the chromium+keyboard gate; still exported (luakit stability) otherwise. 2. Chromium's sandboxed renderer emits no accessibility events until forced, so Onboard never hears a focus event even with the bridge up. Append --force-renderer-accessibility=complete under the same gate, keeping the a11y-tree CPU/RAM cost off systems that don't use the keyboard. Confirmed on glass: Beelink EQi12 / Iris Xe / 43" touch panel — tap a field in Maps/Earth and Onboard auto-pops. Note: the luakit auto-show path is unchanged by this commit but was not re-tested on this hardware; flagging for maintainer review.
Page.reload with ignoreCache is not enough on Home Assistant. The frontend registers a service worker and HA serves /local/ with max-age 31d, so the SW answers from cache storage and the reload returns stale assets -- the visible symptom is refresh_browser appearing to do nothing after an edit to a custom card or other /local/ resource. _cdp_hard_refresh() clears the HTTP cache, then service workers and cache storage for the HA origin, then reloads -- all over one WebSocket session rather than reconnecting per command. The luakit path (ctrl+r) is unchanged. _cdp_command() is untouched and still used by launch_url.
The overlay and the Chromium policy file carried naming and styling from the dashboard they were first written for. Nothing functional changes; this is so the feature reads as part of the add-on rather than as one user's private setup. - button label WALL -> DASHBOARD - element id wall-kiosk-back -> haoskiosk-back, onWall -> onDash - drop the hardcoded #0E1116 and the Lato font stack for a neutral #1c1c1c and system-ui; the style string is a single inline attribute and is still the documented place to restyle the button - chromium policy file wall-kiosk.json -> haoskiosk.json (run.sh and both README copies)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows up on #118. Adds a
browser: luakit|chromiumoption, default luakit — existing setups unchanged. Chromium is opt-in.WebKitGTK hard-hangs on Intel Iris Xe (
i915 GPU HANGin dmesg); Chromium runs clean on the same box. @YogatBear also tested this branch on a 4GB RPi and it fixed several luakit issues for them, including #56, with negligible RAM cost.What's in it:
config.yaml— browser option (default luakit)run.sh— conditional launch/flags; chromium first-run nag suppressedrest_server.py— chromium navigate/refresh via CDP so launch_url/refresh_browser still workcdp_auth.py— token-inject login over trusted loopback (no on-screen login)kiosk_overlay.py— back-to-dashboard button for kiosk-out pagesrun.sh(2nd commit) — fixes Onboard onscreen-keyboard on chromium, gated so luakit is untouched. luakit auto-show path unchanged but not re-tested on my hardware.Tested: Beelink EQi12 / Iris Xe / 43" touchscreen panel — boot, live WebRTC cameras, gestures, screen-off, survives restart. Plus @YogatBear's RPi.
Note: Alpine chromium isn't available on armhf/i386 — that path arch-guards and errors gracefully; luakit stays available everywhere.