ac-electron: actually load the xbox controller bridge (file was orphaned)
The gamepad bridge added in 042e4f8ac landed in ac-electron/flip-view.html,
but main.js loads renderer/flip-view.html — two divergent copies have been
drifting since d21a8cd59. The "fix" was never running, so navigator.getGamepads()
inside the webview stayed empty in the installed Electron app.
- Port the host->guest gamepad bridge into renderer/flip-view.html (the
file main.js actually loads). The bridge polls navigator.getGamepads()
at the host BrowserWindow and forwards a snapshot via IPC, where
webview-preload.js patches navigator.getGamepads in the guest renderer.
- Grant sticky user activation to the host webContents on did-finish-load
via webContents.executeJavaScript('1', true). Chromium gates the Gamepad
API behind sticky activation; in a <webview>-host setup the user
typically clicks inside the webview and the host never receives one,
which made the bridge silently send empty snapshots even when a pad
was plugged in.
- Also grant the guest webview activation on dom-ready as a belt-and-
suspenders fallback so its native getGamepads works too.
- Delete the orphaned ac-electron/flip-view.html so future edits land
in the file that actually ships.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>