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:
parent
5de0ff59f4
commit
ff7215a4b1
1 changed files with 80 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue