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:
parent
7cac5c8e9f
commit
2bf4cf5a20
|
@ -2410,10 +2410,14 @@ RFB.encodingHandlers = {
|
||||||
QEMUExtendedKeyEvent: function () {
|
QEMUExtendedKeyEvent: function () {
|
||||||
this._FBU.rects--;
|
this._FBU.rects--;
|
||||||
|
|
||||||
|
// Old Safari doesn't support creating keyboard events
|
||||||
|
try {
|
||||||
var keyboardEvent = document.createEvent("keyboardEvent");
|
var keyboardEvent = document.createEvent("keyboardEvent");
|
||||||
if (keyboardEvent.code !== undefined) {
|
if (keyboardEvent.code !== undefined) {
|
||||||
this._qemuExtKeyEventSupported = true;
|
this._qemuExtKeyEventSupported = true;
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
JPEG_quality_lo: function () {
|
JPEG_quality_lo: function () {
|
||||||
|
|
Loading…
Reference in New Issue