Pierre Ossman [Fri, 16 Aug 2019 09:18:45 +0000 (11:18 +0200)]
Use "nomodule" instead of manual check
Very few browsers are left in the wild that supports modules but not
"nomodule", so let's simplify our handling a bit.
Safari 10 supports modules but not 'nomodule', this means that this
particular version of Safari will be broken. Due to this we have to
bump up the required Safari version to 11.
Niko Lehto [Tue, 17 Sep 2019 07:28:30 +0000 (09:28 +0200)]
Add support for VMware cursor encoding
Supports both classic cursor type and alpha cursor type. In classic
mode the server can send 'inverted' pixels for the cursor, our code
does not support this but handles these pixels as opaque black.
Co-authored-by: Samuel Mannehed <samuel@cendio.se>
Pierre Ossman [Fri, 23 Aug 2019 11:58:40 +0000 (13:58 +0200)]
Deprecate showDotCursor option for RFB constructor
It is not relevant for the connection stage so it should not have
been a constructor argument to begin with. Ship with a warning for
a release before we remove it.
Pierre Ossman [Fri, 23 Aug 2019 11:57:30 +0000 (13:57 +0200)]
Make sure showDotCursor can be modified before connecting
The cursor object is only attached to our canvas whilst connecting,
so we need to make sure we don't try to update anything when were
not connected or we'll get a crash.
Jesper Alf Dam [Wed, 7 Aug 2019 09:12:35 +0000 (11:12 +0200)]
When compacting the receive buffer don't copy unused buffer space
When compacting the receive buffer, we should only copy the bytes
between _rQi and _rQlen (the index of the first unread byte, and the
next write position).
Previously, we copied everything for _rQi up untill the end of the
buffer.
Jesper Alf Dam [Wed, 7 Aug 2019 09:03:12 +0000 (11:03 +0200)]
Don't compact the receive buffer unless we've actually run out of space
Previously, we would compact the buffer (moving unread data to the
start of the buffer) as follows:
- after processing a message, if there are zero unread bytes, just reset
the indices for first and last unread byte to zero
- else, if at least 1/8th of the buffer is used, copy remaining data to the beginning of the buffer
The second option is never actually necessary, as before inserting new data
into the array, we already check if there's enough free space, and
compact the buffer first if necessary. So we've been doing a lot of
copies that weren't actually needed. Let's not do that any more.
Jesper Alf Dam [Fri, 16 Aug 2019 12:27:12 +0000 (14:27 +0200)]
Avoid recursion in Alt check on Firefox
The Firefox workaround which checks for missing Alt key events may
synthesise new KeyboardEvents. On these events, checkAlt should not be
recursively triggered. Otherwise, we get "too much recursion" errors
whenever the Alt key is pressed.
Tim Edwards [Thu, 25 Jul 2019 20:22:48 +0000 (06:22 +1000)]
Added a Snap package for noVNC (#1231)
Creating an Ubuntu Snap package to make noVNC easier to deploy.
Checks for the websockify binary in both the PATH (using which) and in the location where the Snap package places the binary. This is necessary for noVNC to be usable in a Snap. It doesn't affect the original functionality of git cloning websockify if it's not found in PATH or the Snap location.
Lee Yarwood [Tue, 9 Jul 2019 11:12:43 +0000 (12:12 +0100)]
launch.sh: Check for a local websockify directory
Previously launch.sh would check both for the existence of a local
websockify file and /websockify/run file.
This initial check should really be for a local websockify directory
as in packaged environments a file could very well be the actual
executable leading to launch.sh incorrectly attempting to use a local
version of websockify.
Pierre Ossman [Fri, 24 May 2019 11:06:26 +0000 (13:06 +0200)]
Remove server pixel format warnings
These are harmless and really only for debugging. So remove them
as they tend to trick people in to thinking something is wrong.
We already print the entire server pixel format earlier anyway in
case we need the details.
Samuel Mannehed [Tue, 2 Apr 2019 14:45:51 +0000 (16:45 +0200)]
Allow autoscale() with zero height or width
Commit 6e7e6f9 stopped the function from running if width or height was
zero, this commit reverts that change. This commit also makes the
resulting canvas 0x0 if autoscale is called with zero. By adding this
special case we can avoid division by zero in the calculations.
Pierre Ossman [Fri, 15 Feb 2019 12:14:36 +0000 (13:14 +0100)]
Remove error handling in clientCutText()
It is not necessary as Websock.flush() is guaranteed to succeed and
give us some space. It also remove the call to _fail(), which was
invalid at this place as clientCutText() is not a method on RFB.
Pierre Ossman [Thu, 14 Feb 2019 15:57:26 +0000 (16:57 +0100)]
Consume data properly in Hextile decoder
We accidentally removed the code updating the data index in 8a189a6,
resulting in the decoder newer consuming any data. So the data would
be parsed as the next rect, causing weird errors.