Solly Ross [Wed, 24 Feb 2016 20:59:58 +0000 (15:59 -0500)]
Make sure to copy arrays when using render queue
This commit ensures that input arrays are copied to new storage when
they are pushed onto the render queue. This ensures that they are
not overwritten before they are eventually used.
If a token is already present in the path, the new variable
is ignored. In order to properly manipulate the path,
a new method, `WebUtil.injectParamIfMissing` was introduced.
Solly Ross [Wed, 6 Jan 2016 18:26:26 +0000 (13:26 -0500)]
Fixed vnc_perf.html
This commit updates vnc_perf.html so that it works with the current
version of noVNC. It also introduces a utility to convert noVNC session
recordings recorded in base64-mode to binary-mode recordings, since noVNC
no longer supports base64-mode.
Solly Ross [Wed, 6 Jan 2016 16:18:47 +0000 (11:18 -0500)]
Remove unused variables in the TIGHT server init
This commit removes some unused variables in the TIGHT server init
section of the server init handler, replacing them with documenting
comments and calls to rQskipBytes.
Solly Ross [Tue, 22 Dec 2015 18:51:30 +0000 (13:51 -0500)]
Disable copyWithin Use in Websock.js
the `copyWithin` function of typed arrays has performance issues
in some versions of Chromium, and doesn't doesn't have enough
of a performance impact to justify leaving it enabled.
Add hash fragment as an optional method to supply config variables.
Any config variable like host, port, password, token may be
specified either in the query string (like now), or in the URL hash
fragment. In case a given variable is present in both, the value in the
fragment takes precedence. Supplying variables in the fragment avoids
leaking them to the web server hosting the noVNC viewer HTML.
Solly Ross [Tue, 22 Sep 2015 20:19:52 +0000 (16:19 -0400)]
Make sure Pako always has enough room
Previously, we used a fixed chunkSize of 100KiB for Pako's output
buffer. Using a hardcoded size caused issues, since Pako would assume
we wanted to use multiple chunks, and we didn't deal with this. Now,
`Inflator#inflate()` takes a new `expected` argument, which indicates
the expected output size. If this is bigger than the current chunkSize,
Inflator allocates a new output buffer that's big enough to hold the
output.
Solly Ross [Wed, 26 Aug 2015 18:28:10 +0000 (14:28 -0400)]
Fix buffer over-reads in handle_tight
For performance reasons, the `handle_tight` function skips the
use of the receive queue API and uses the raw receive queue directly.
Because of the way that typed array receive queue gets reused, this
introduced the potential for buffer over-reads.
To address this, a new function, `rQwhole`, was introduced.
`rQwhole` simply returns a new view into the receive queue that
starts at 0 and ends at the current recorded end of the queue.
Solly Ross [Mon, 24 Aug 2015 23:34:30 +0000 (19:34 -0400)]
Fix bug in non-true-color code
There was a bug caused by 38781d931ec18304f51ed3469faff8387e3cbc55
which prevented color map look-ups sent by rfb.js from working properly,
since display.js expected a single-item array, and rfb.js sent just them
item value itself (a number) instead. This fixes that, and tweaks the
corresponding test to match that behavior.
Solly Ross [Mon, 24 Aug 2015 23:30:44 +0000 (19:30 -0400)]
Tests: Fixed bug in displayed assertion
This `displayed` assertion had a bug that was causing it to not
actually check anything (it was using obj.length instead of
data_cl.length). This fixes that.
samhed [Fri, 14 Aug 2015 15:02:00 +0000 (17:02 +0200)]
Only work with integers when panning to avoid getting a blurry image.
Also disable image-smoothing to avoid bugs seen on Android which were
also causing a blurry image while panning.
Solly Ross [Tue, 2 Jun 2015 19:32:14 +0000 (15:32 -0400)]
Skip unnecessary render queue object creation
This commit skips object creation for the render queue when not
needed. Instead of pushing an object onto the queue, and then
immediately running the result, you call the function directly.
Then, if the render queue is not empty, an object is created and
pushed onto the queue. Otherwise, the functionality is just run
directly.
Solly Ross [Thu, 28 May 2015 19:07:43 +0000 (15:07 -0400)]
Allow the use of the PhantomJS remote debugger
This commit adds the '--debugger <port>' option, which triggers
the PhantomJS remote debugger. The initial output of the terminal
when running the debugger gives more information on how to use
it.
Solly Ross [Thu, 28 May 2015 19:28:30 +0000 (15:28 -0400)]
Use Typed Arrays for the send queue
This commit converts the send queue to use typed arrays, and converts
message creation functions in 'rfb.js' to create messages directly into
the socket's send queue. This commit also removes the separate mouse array,
which is no longer needed.
Solly Ross [Thu, 28 May 2015 19:27:40 +0000 (15:27 -0400)]
Avoid Creating Small Objects Frequently
Creating lots of small objects frequently can drastically decrease
performance. This commit introduces three fixes which avoid this:
- Use a preallocated palette and indexed-to-rgb destination Typed Array
(the destination typed array is currently allocated at `4 * width *
height`).
- Inline `getTightCLength`, which returned a two-item array.
- Pass RGBX data directly in a Typed Array to the Display, which
avoids an extra loop, and only creates a new Typed Array View,
instead of a whole new ArrayBuffer.
This commit converts websock.js to used Typed Arrays for the
receive queue (and tweaks rfb.js to ensure that it continues
to function, since only Firefox implements
`%TypedArray%.prototype.slice`). Base64 support was removed
to simplify code paths, and pave the way for using Typed Arrays
for the send queue as well.
This provides two advantages: first, we allocate a buffer ahead
of time, meaning the browser doesn't have to do any work dynamically
increasing the receive queue size. Secondly, we are now able to pass
around Typed Array Views (e.g. `Uint8Array`), which are lightweight, and
don't involve copying.
The downside is that we initially allocate more memory -- we currently
start out with 4 MiB, and then automatically double when it looks like
the amount unused is getting to small.
The commit also explicitly adds a check to the compacting logic that
avoids calling the copy functions if `_rQlen === _rQi`.
Solly Ross [Thu, 6 Aug 2015 18:37:01 +0000 (14:37 -0400)]
CI: Switch to Container-Based Travis
This commit switches the Travis tests over to Travis's new
container-based infrastructure. It also tells Travis to
cache the node_modules directory for faster setup.
samhed [Thu, 25 Jun 2015 20:28:04 +0000 (22:28 +0200)]
* Hide the fullscreen toggle button on Safari since alphanumerical
keyboard input doesn't work in fullscreen.
* Force clipping mode in Internet Explorer while in fullscreen since
scrollbars doesn't work in fullscreen.
samhed [Thu, 25 Jun 2015 15:04:55 +0000 (17:04 +0200)]
Renamed popupStatusPanel to popupStatus and removed the global variable
which kept track on if it was open or not (it automatically closes after
1.5 seconds anyway).
samhed [Tue, 16 Jun 2015 20:39:17 +0000 (22:39 +0200)]
Always show the viewport drag button on touch devices to keep the GUI from
"jumping around". Enable/disable the button instead of show/hide on these
devices.
samhed [Tue, 19 May 2015 11:34:50 +0000 (13:34 +0200)]
Reverting most of commit cb3e4de. The issue was not related to using keyboardinputReset.. the issue was infact a typo which was introduced in 3b8ec46. I must be too tired..
Solly Ross [Tue, 24 Mar 2015 20:02:53 +0000 (16:02 -0400)]
Throw exceptions from RFB constructor
Previously, if an error was thrown from the Display constructor
in the RFB constructor, we would attempt to use `RFB#updateState`
to handle this. However, `RFB#updateState` attempts to close
the WebSocket connection, which doesn't exist at this point.
In the constructor, it's probably just better to raise an exception
instead (making sure to clean up anything relevant).
Solly Ross [Tue, 24 Mar 2015 19:05:38 +0000 (15:05 -0400)]
Create RFB object on connect
In e543525faa9cf0d683f41e183e89cd909f3dd229, we switched to creating
a new RFB object on disconnect. This caused issues, however, since
any errors were only displayed briefly before the new "loaded" text
was displayed instead.
Now, we create the RFB object on connect. This essentially removes
the usefulness of the "loaded" state, but prevents the aforementioned
problem.
To facilitate this, the code which does detection of cursor URI support
was moved from this Display constructor (which now calls the new
function) into its own function, `Util.browserSupportsCursorURIs()`.
Solly Ross [Thu, 26 Mar 2015 20:57:17 +0000 (16:57 -0400)]
Follow symbolic links in launch.sh
Previously, in launch.sh, `$HERE` was the directory of `$0`.
However, if `$0` was actually a symlink, `$HERE` would be
wherever the symlink was, which could cause issues (for
example, the script wouldn't be able to local `$WEB` or
`$WEBSOCKIFY` properly).
Now, `$HERE` looks at whatever `$0` points at instead.
samhed [Mon, 9 Mar 2015 13:30:56 +0000 (14:30 +0100)]
* Don't check specific html elements from the display code (Fixes #446)
* Renamed and reworked fbuClip to clippingDisplay
* Added tests for clippingDisplay
* Use the a noVNC_container which covers the entire page to get the full size
(Fixes #463)
* Added maxWidth and maxHeight to the canvas which can limit the viewport size
* Only show either the canvas or the logo, hide one when the other is shown
* Always center the canvas (previously it was only centered when not clipping)
* Removed iOS specific "position-fixed" fixes and start calling setBarPosition
on every resize
* Removed the noVNC_screen_pad
samhed [Thu, 5 Mar 2015 13:56:47 +0000 (14:56 +0100)]
* Change name of ext_desktop_size to the proper ExtendedDesktopSize
* Added better error handling in ExtendedDesktopSize
* Added helper function to share code with DesktopSize
* Update test.rfb.js to only check for error handling if we were the
ones requesting the resize
Solly Ross [Wed, 18 Feb 2015 03:41:34 +0000 (22:41 -0500)]
Support local scaling
This commit adds two new addition scaling options. Both options do
local scaling. The first "Local Scaling", does both upscaling and
downscaling. The second option, "Local Downscaling", only downscales.
This is based on work by @mightypenguin (with an additional bug
reported by @glazik12).
Solly Ross [Tue, 17 Feb 2015 23:53:38 +0000 (18:53 -0500)]
Update UI to allow for different scaling modes
This commit updates the UI to allow for different
scaling modes. The "resize" option was changed to
be a dropdown with the following options: "None" (nothing),
"Remote Resizing" (SetDesktopSize).
Solly Ross [Wed, 25 Feb 2015 22:02:16 +0000 (17:02 -0500)]
Make Util.getPosition be relative to page
Commit 5108c4635c847de9be0edadf572f7426f351b66a caused a regression
in the case where scrolling is used -- getPosition return position
relative to the viewport, while getEventPosition expected a position
relative to the page.
As per
https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect,
the fix for this is simply to add the `pageXOffset` and `pageYOffset` to
the output of `getBoundingClientRect()`.
Solly Ross [Fri, 20 Feb 2015 22:27:27 +0000 (17:27 -0500)]
Fix disconnect/reconnect issues
Commit 155d78b39933a396d2555376f4e70f976c30b86d prevented reconnections
from working properly. This fixes that by creating a new RFB object
after disconnecting or failing.
Furthermore, this ensures that a new connection cannot be opened util
we've actually disconnected (either by timer or by receiving a `close`
event).
Solly Ross [Fri, 20 Feb 2015 22:31:37 +0000 (17:31 -0500)]
Remove 'debian' directory
This commit removes the old debian packaging information, which is
out of date. People who wish to create Debain packages for noVNC
are better off using the package information from the actual Debian
or Ubuntu packages.
Solly Ross [Tue, 17 Feb 2015 22:54:21 +0000 (17:54 -0500)]
Make sure websockify is cloned to the correct dir
When `utils/launch.sh` clones websockify, it can be cloned
into the incorrect directory, depending on how `utils/launch.sh`
is run. This commit ensures that websockify is always cloned into
`utils/websockify`.
Solly Ross [Mon, 16 Feb 2015 22:03:17 +0000 (17:03 -0500)]
Remove local copies of websockify
This commit removes local copies of websockify.
Instead `utils/launch.sh` performs the following logic:
If `utils/websockify` exists, use `utils/websockify/run` (if the latter
does not exist, or is not executable, fail, since this is probably a
mistake).
Otherwise, check to see if websockify is installed somewhere (try
`which websockify`). If it is, use that. Otherwise, clone
websockify from github, and tell git to ignore that directory.
Packaged versions of noVNC should simply list websockify as a
requirement. The debian packaging has been updated to reflect
this.
samhed [Tue, 10 Feb 2015 16:05:58 +0000 (17:05 +0100)]
Support automatic resize [Part 3/4]: ui.js
* Added a resize request (setDesktopSize) triggered when connecting and by
changes to the browser window's size.
* Hid the view-drag-hand when the display area is the same or smaller than the
remote session size.
* Added a setting for the automatic resize feature.
* Updated vnc.html and vnc_auto.html to reflect the changes to the UI.