From e93807ade2fc218aff1916eb27b0b276c3b3835a Mon Sep 17 00:00:00 2001 From: Solly Ross Date: Tue, 22 Dec 2015 15:16:52 -0500 Subject: [PATCH 1/2] Fix ImageData Constructor Support Detection Our support detection for the `ImageData(data, width, height)` constructor would fail in certain browsers because the size of a 1x1 ImageData's Uint8ClampedArray is 4, not 1. --- include/display.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/display.js b/include/display.js index a492817..a6a5722 100644 --- a/include/display.js +++ b/include/display.js @@ -17,7 +17,7 @@ var Display; var SUPPORTS_IMAGEDATA_CONSTRUCTOR = false; try { - new ImageData(new Uint8ClampedArray(1), 1, 1); + new ImageData(new Uint8ClampedArray(4), 1, 1); SUPPORTS_IMAGEDATA_CONSTRUCTOR = true; } catch (ex) { // ignore failure From 2a10f1bd56e492b32155e5767726eabc0f6c796f Mon Sep 17 00:00:00 2001 From: Solly Ross Date: Wed, 24 Feb 2016 16:13:06 -0500 Subject: [PATCH 2/2] Revert poor workaround for brief Firefox bug This commit reverts a fix for a bug which briefly occured on certain nightlies of Firefox. It was never intended to persist in the code base, and is causing other actual errors to be swallowed. --- include/rfb.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/include/rfb.js b/include/rfb.js index d0e6c8f..694c14b 100644 --- a/include/rfb.js +++ b/include/rfb.js @@ -1165,14 +1165,7 @@ var RFB; this._timing.last_fbu = (new Date()).getTime(); - var handler = this._encHandlers[this._FBU.encoding]; - try { - //ret = this._encHandlers[this._FBU.encoding](); - ret = handler(); - } catch (ex) { - console.log("missed " + this._FBU.encoding + ": " + handler); - ret = this._encHandlers[this._FBU.encoding](); - } + ret = this._encHandlers[this._FBU.encoding](); now = (new Date()).getTime(); this._timing.cur_fbu += (now - this._timing.last_fbu);