Folder image slideshow sites; Electron 42 -> 44
Slideshow: a site whose path is a local folder (/home/kiosk/photos/, or any existing directory) plays its images full-screen instead of showing Chromium's directory listing. kiosk-app/slideshow.js maps the folder URL to slideshow.html (resolveSiteUrl - used where main.js loads a view and where attachView re-checks the configured URL) and pushes the image list into the page from the main process (the page has no fs access), re-read every minute so added/removed images show up without a restart. Natural file-name order, crossfade, letterboxed by default; optional slideshow.json in the folder: interval, shuffle, fit, transition, recursive. provision_install_app already copies kiosk-app/*.js/*.html, so new installs and Advanced -> Upgrade pick it up. Electron: ^42.0.0 -> ^44.0.0. Electron supports the latest three majors (44/43/42), so 42 drops out when 45 ships. Checked the 43/44 breaking changes against kiosk-app: nothing it uses changed (no clipboard, safeStorage, net.request, utilityProcess; BrowserView is deprecated but still present through 46). The offline bundle builder now retries Electron's install.js download, which crashes outright if a large download is cut off mid-stream. Tested with the real main.js on Electron 44.5.1 under Xvfb + Openbox: slideshow fills the screen, cycles in order (01, 02, 10) skipping a .txt file, honours slideshow.json, and an image added mid-run joined the rotation after the refresh. Offline bundle rebuilt with Electron 44.5.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cjz8a58eB5P9sUweqd3NHm
This commit is contained in:
@@ -185,7 +185,14 @@ build_modules() {
|
||||
# postinstall since ~v42) - lib/electron.sh runs this same install.js
|
||||
# on the target when online; offline it has to already be in dist/.
|
||||
if [[ -f "$tmp/node_modules/electron/install.js" ]]; then
|
||||
(cd "$tmp" && node node_modules/electron/install.js) || die "Electron binary download failed"
|
||||
# Retried: a large download cut off mid-stream crashes it outright.
|
||||
local try
|
||||
for try in 1 2 3; do
|
||||
(cd "$tmp" && node node_modules/electron/install.js) && break
|
||||
(( try < 3 )) || die "Electron binary download failed (3 attempts)"
|
||||
info "Electron download failed - retrying ($((try + 1))/3)..."
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
tar -czf "$OUT_DIR/npm/${name}-node_modules.tar.gz" --owner=0 --group=0 -C "$tmp" node_modules
|
||||
info "$name: $(du -sh "$tmp/node_modules" | cut -f1) -> $(du -h "$OUT_DIR/npm/${name}-node_modules.tar.gz" | cut -f1) compressed"
|
||||
|
||||
Reference in New Issue
Block a user