Pierre Ossman [Wed, 18 Jan 2017 14:59:31 +0000 (15:59 +0100)]
Fix global error handler
It stopped working when we switched to textContent as it relies
on being able to add new HTML elements. Do things properly by
adding new elements via createElement().
Solly Ross [Thu, 12 Jan 2017 16:43:35 +0000 (11:43 -0500)]
Use textContent instead of innerHTML
Previously, setting `innerHTML` was used to display the statuses. These
could include content communicated from the remote VNC server, allowing
the remove VNC server to inject HTML into the noVNC page.
This commit switches all uses of `innerHTML` to use `textContent`, which
is not vulnerable to the HTML injection.
Samuel Mannehed [Mon, 9 Jan 2017 11:49:10 +0000 (12:49 +0100)]
Fix rfb._cleanup() (#743)
We don't have to check for _display or context here since this is a
private function which is never called under such circumstances. This
solves problems caused by display.get_context() which was previously
removed in e549ae074fcea9febde32c0fa260a64c15cc1b8e.
Pierre Ossman [Mon, 14 Nov 2016 16:17:05 +0000 (17:17 +0100)]
Clean up z index ordering
We have enough layers now that we need to have some system for this.
E.g. make sure that dialogs during connect show up in front of the
blocking transition layer.
Pierre Ossman [Sun, 30 Oct 2016 20:36:54 +0000 (21:36 +0100)]
Remove alternative style sheets
Anyone with basic knowledge of CSS will easily figure out how to
customise the appearance of the UI, so remove the burden of having
to maintain these extra style sheets.
Pierre Ossman [Tue, 25 Oct 2016 14:58:21 +0000 (16:58 +0200)]
Use double buffering for the display
Do all rendering to a hidden canvas and then copy over the finished
frame to the visible canvas once everything is done. This simplifies
things and solves some bugs as we can retain a copy of the entire
frame buffer.
Pierre Ossman [Mon, 24 Oct 2016 15:37:21 +0000 (17:37 +0200)]
Run performance tests at full speed
setTimeout() is subject to delays, possible massive ones. As such it
is rather useless for performance sensitive code. Use the non-standard
setImmediate() API instead, emulating it on postMessage() when it
isn't available.
Pierre Ossman [Tue, 29 Nov 2016 15:06:20 +0000 (16:06 +0100)]
Skip language tests on broken browsers
The hacks needed to run these tests require proper handling of
properties. Unfortunately IE and old versions of Chrome mess up,
so just skip the tests there.
Samuel Mannehed [Mon, 28 Nov 2016 15:11:47 +0000 (16:11 +0100)]
Fix translation util tests
We have to temporarily replace window.navigator due to the fact that
its property languages is read-only. The tests for the translation
utilities require different values of this property. The failing tests
were added in merge of PR #718 (in commit f5bf2d84ef1bae02dfaff068de7565664a00fba3).
Samuel Mannehed [Mon, 28 Nov 2016 11:36:29 +0000 (12:36 +0100)]
Clear UI.connected state variable right away
Keeping it set for the disconnecting state was causing an issue where
the controlbar could be hidden without any way to open it, when a
session disconnects too quickly.
Samuel Mannehed [Wed, 9 Nov 2016 14:54:10 +0000 (15:54 +0100)]
Allow specifying details when calling RFB._fail()
RFB's _fail function logs the error, disconnects the session and sets
disconnect_reason. The disconnect_reason is upon disconnection sent to
the user interface. It is thus not suitable for including error details
that aren't user friendly. The idea is that you will look in the
browser console for a full log with details of the error.
Samuel Mannehed [Tue, 8 Nov 2016 17:18:19 +0000 (18:18 +0100)]
Don't wait for websocket closes on failure
RFB._fail() can be called at any time in any state, it is not certain
that we will get a close event on the socket since the socket might not
be open. This caused us to hit the disconnect timeout in such cases.
Samuel Mannehed [Sat, 5 Nov 2016 17:18:15 +0000 (18:18 +0100)]
Handle errors while opening a Websocket
For example, previously if the user typed in illegal characters in the
port field, no error would be displayed in the interface and the page
would stop at "connecting".
Samuel Mannehed [Thu, 10 Nov 2016 10:57:45 +0000 (11:57 +0100)]
Fix keysyms.fromUnicode() tests
Node.js doesn't handle characters high up in the unicode range
properly with charCodeAt(). Adding a new test for UCS-4 codepoints
using codePointAt() to cover this.
Samuel Mannehed [Wed, 26 Oct 2016 13:43:43 +0000 (15:43 +0200)]
Always disable forced touch gestures
Don't only disable these for the canvas, disable for the entire page.
There were issues where the control bar handle couldn't be moved on
IE and Edge on Microsoft Surface devices due to these "touch-actions".
Pierre Ossman [Thu, 22 Sep 2016 08:28:35 +0000 (10:28 +0200)]
Wait for proper image load event
There is a specific event for when an image has finished loading,
so trigger on that rather than polling. The polling interval of
requestAnimationFrame() can also be very large.
Pierre Ossman [Thu, 22 Sep 2016 08:19:26 +0000 (10:19 +0200)]
Hide image handling in display object
The callers don't need to concern themselves with how images are
rendered, so hide the details behind the API. This also avoids
exposing the render queue.