summaryrefslogtreecommitdiff
path: root/core/rfb.js
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2020-12-04 16:44:54 +0100
committerPierre Ossman <ossman@cendio.se>2020-12-07 10:10:53 +0100
commit5b5b747494742eddf2bab63f29c1e4a25d59efc9 (patch)
tree579eac80c96c76e5692d38c7ec68ae55273ae4fa /core/rfb.js
parent6cd9bacf8bbf1c87c9e7421aad61e792c6b10caa (diff)
downloadnovnc-5b5b747494742eddf2bab63f29c1e4a25d59efc9.tar.gz
Remove many small, obsolete, old browser hacks
These are for browsers no longer supported anyway.
Diffstat (limited to 'core/rfb.js')
-rw-r--r--core/rfb.js33
1 files changed, 6 insertions, 27 deletions
diff --git a/core/rfb.js b/core/rfb.js
index b1ed475..7e177ba 100644
--- a/core/rfb.js
+++ b/core/rfb.js
@@ -187,8 +187,6 @@ export default class RFB extends EventTargetMixin {
this._canvas.style.margin = 'auto';
// Some browsers add an outline on focus
this._canvas.style.outline = 'none';
- // IE miscalculates width without this :(
- this._canvas.style.flexShrink = '0';
this._canvas.width = 0;
this._canvas.height = 0;
this._canvas.tabIndex = -1;
@@ -1263,17 +1261,6 @@ export default class RFB extends EventTargetMixin {
}
_negotiateSecurity() {
- // Polyfill since IE and PhantomJS doesn't have
- // TypedArray.includes()
- function includes(item, array) {
- for (let i = 0; i < array.length; i++) {
- if (array[i] === item) {
- return true;
- }
- }
- return false;
- }
-
if (this._rfbVersion >= 3.7) {
// Server sends supported list, client decides
const numTypes = this._sock.rQshift8();
@@ -1290,15 +1277,15 @@ export default class RFB extends EventTargetMixin {
Log.Debug("Server security types: " + types);
// Look for each auth in preferred order
- if (includes(1, types)) {
+ if (types.includes(1)) {
this._rfbAuthScheme = 1; // None
- } else if (includes(22, types)) {
+ } else if (types.includes(22)) {
this._rfbAuthScheme = 22; // XVP
- } else if (includes(16, types)) {
+ } else if (types.includes(16)) {
this._rfbAuthScheme = 16; // Tight
- } else if (includes(2, types)) {
+ } else if (types.includes(2)) {
this._rfbAuthScheme = 2; // VNC Auth
- } else if (includes(19, types)) {
+ } else if (types.includes(19)) {
this._rfbAuthScheme = 19; // VeNCrypt Auth
} else {
return this._fail("Unsupported security types (types: " + types + ")");
@@ -2183,15 +2170,7 @@ export default class RFB extends EventTargetMixin {
return this._handleCursor();
case encodings.pseudoEncodingQEMUExtendedKeyEvent:
- // Old Safari doesn't support creating keyboard events
- try {
- const keyboardEvent = document.createEvent("keyboardEvent");
- if (keyboardEvent.code !== undefined) {
- this._qemuExtKeyEventSupported = true;
- }
- } catch (err) {
- // Do nothing
- }
+ this._qemuExtKeyEventSupported = true;
return true;
case encodings.pseudoEncodingDesktopName: