Watch
0
0
Fork
You've already forked hyperhive
0

agent: let the screen page keep reload, the address bar and its own buttons

The page forwarded every key to the remote desktop and cancelled it, so F5 and
Ctrl+R could not reload, though the disconnect message tells the operator to
reload, and Enter or Space on the fit and debug buttons did nothing. F5, F12,
Ctrl/Cmd+R, Ctrl/Cmd+L and any key pressed on a button now go to the browser;
the rest still go to the remote desktop. The filter is a small module with a
test, bundled for the page as static/screen-keys.js, and the agent-page doc
describes it.
This commit is contained in:
iris 2026-11-25 19:24:08 +01:00
commit ff7215a4b1

View file

@ -32,6 +32,7 @@
<div id="msg"></div>
<div id="debug-log"></div>
<script src="static/screen-keys.js"></script>
<script>
// Minimal RFB-over-WebSocket renderer. Connects to `screen/ws` on
// the same host; the harness relays raw RFB bytes to the VNC server
@ -942,6 +943,9 @@
document.addEventListener("keyup", (ev) => sendKey(ev, 0));
function sendKey(ev, down) {
// Reload, the address bar, the dev tools and the page's own buttons
// keep their keys (src/screen-keys.js).
if (hiveScreenKeys.keepForBrowser(ev)) return;
ev.preventDefault();
const key = rfbKeysym(ev);
const b = new Uint8Array(8);