mirror of
https://github.com/novnc/noVNC.git
synced 2026-05-29 08:29:38 +00:00
try/catch guard for QEMU keyboard test
Safari on older iOS doesn't support creating KeyboardEvent objects, so put a guard in to avoid crashes.
This commit is contained in:
10
core/rfb.js
10
core/rfb.js
@@ -2410,9 +2410,13 @@ RFB.encodingHandlers = {
|
||||
QEMUExtendedKeyEvent: function () {
|
||||
this._FBU.rects--;
|
||||
|
||||
var keyboardEvent = document.createEvent("keyboardEvent");
|
||||
if (keyboardEvent.code !== undefined) {
|
||||
this._qemuExtKeyEventSupported = true;
|
||||
// Old Safari doesn't support creating keyboard events
|
||||
try {
|
||||
var keyboardEvent = document.createEvent("keyboardEvent");
|
||||
if (keyboardEvent.code !== undefined) {
|
||||
this._qemuExtKeyEventSupported = true;
|
||||
}
|
||||
} catch (err) {
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user