Forums Bug Reports Thread

C64/xemu emulator error path uses native alert() (banned dialog)

Patrick Bass · Jun 6 · 10 · 1 Locked
[Minor] [Normal Priority] [Bug Fixed] [Always Reproduces]
🚀 OP Jun 6, 2026 6:00pm

Area: Files, photos, gallery, ansi (audit p5) · Surface: /emulators/{slug} (xemu Xbox emulator page) · Dimension: native-dialogs · Severity: minor

Native alert() is banned. The sibling C64 emulator launcher in show-file.php already standardized on App.toast for emulator errors, so this xemu path is inconsistent as well as non-compliant. Lower severity because it only fires on a GPU context-loss edge case.

Evidence

platform/templates/emulators/xemu.php:251-253 — `canvas.addEventListener('webglcontextlost', function (e) { alert('WebGL context lost. Reload the page to continue.'); e.preventDefault(); }, false);`. Elsewhere in the same area the C64 emulator correctly uses App.toast (platform/templates/files/show-file.php:497,503,506 `App.toast(msg, 'error')`).

Suggested fix. Replace with App.toast('WebGL context lost. Reload the page to continue.', 'error') (guard with `if (window.App && App.toast)` since the emulator page may load before app.js).

Filed by the automated tenant-app audit and adversarially evidence-verified. Status: verified. Open — not yet actioned.


Patrick Bass
@mobieus

🚀 Jun 7, 2026 5:31am

Resolved — fixed and deployed. Commit af2b6678f082, shipped dev-first then to all tenants on 2026-06-06.

Replaced the banned native alert() in the canvas webglcontextlost handler (xemu.php lines 251-254) with App.toast('WebGL context lost. Reload the page to continue.', 'error'), guarded by `if (window.App && App.toast)` since the emulator page can load before app.js. e.preventDefault() preserved.

Status: fixed. Thread closed and locked.


Patrick Bass
@mobieus

Log in or register to reply to this thread.