Commit Graph

1695 Commits

Author SHA1 Message Date
Samuel Mannehed 5271e30049 Use a simple prompt for passwords in vnc_lite
It's not password-masked, but it allows for a lot simpler code.
2018-08-28 10:42:39 +02:00
Samuel Mannehed 26d51e490e Order vnc_lite functions 2018-08-28 10:42:39 +02:00
Samuel Mannehed c756665e81 Rename functions in vnc_lite
Give them obvious names to make the code easier to understand.
2018-08-28 10:42:39 +02:00
Samuel Mannehed 25551b6b40 Use let and const instead of var in vnc_lite
The rest of noVNC has been converted already. This allows us to remove
the extra scope that was created for the VNC connection.
2018-08-28 10:42:37 +02:00
Samuel Mannehed 6517c498b9 Remove support for the fragment and WebUtil dep
The only remaining use we had of WebUtil was getConfigVar(). Let's get
rid of that dependency and use our own, query-string-only and richly
commented version of that function. It's easier for people to get an
overview of vnc_lite if it's all in one file.

This commit removes support for the fragment, parameters can only be
passed using the query string from now on.
2018-08-28 10:41:56 +02:00
Samuel Mannehed 51f9f0098d Cleanup non-essential options from vnc_lite
This is supposed to be a simple example, it shouldn't have this many
options. This commit removes the following options:
 * logging - the default level 'warn' is good enough
 * title - a weird thing to set from the query string anyway
 * token - not used by most setups
 * encrypt - looking at the URL is good enough
 * repeaterID - not used by most setups
 * shared - uncommon setting
 * resize - not supported by most servers

Note that the removal of 'encrypt' allows us to remove logic for
establishing a default port. The default port for wss is 443 and for ws
it's 80 anyway.
2018-08-28 10:41:52 +02:00
Samuel Mannehed 8c2866df36 Add code comments to vnc_lite 2018-08-28 10:41:19 +02:00
Samuel Mannehed 27dff4a0a2 Simplify connected() function 2018-08-21 12:23:17 +02:00
Samuel Mannehed de79ae92e5 Remove unneccessary code and bling from vnc_lite
Unused code, variables and unnecessary styles. The host/port check
would only have an effect if someone explicitly set them as empty in
the query string. The different colors of the status bar are not
necessary, nor is the styling of the background.
2018-08-21 12:22:57 +02:00
Samuel Mannehed e0d4e5a1c0 Move css rules for vnc_lite to the html
Easier to get an overview if it's all in one file.
2018-08-21 11:34:28 +02:00
Samuel Mannehed e7c1074b65 Get rid of icons for vnc_lite
Icons aren't required and we want to get rid of the 'app/' dependency.
2018-08-20 09:22:05 +02:00
Samuel Mannehed cc2fe2c26e Remove iOS specific code from vnc_lite
vnc_lite.html doesn't have touch support anyway
2018-08-16 15:53:32 +02:00
Samuel Mannehed 0f207c808c Remove machine control buttons from vnc_lite
The vnc_lite example is intended to be minimal and these buttons are
only useful in special cases.
2018-08-16 15:53:32 +02:00
Samuel Mannehed c995c0863e Revert "Handle if desktopName isn't set.."
This reverts commit 22000b93d5. The
'desktopname' and the 'connect' events are dispatched by us in RFB and
are thus serial.
2018-08-16 15:52:21 +02:00
Samuel Mannehed 2c0b146630
Merge pull request #1117 from novnc/bug/fix-test-playback
Fix test playback
2018-08-16 15:38:43 +02:00
Pierre Ossman 16f0861501 Support password auth recordings for playback
When password auth is enabled on the server, the RFB object sends a
'credentialsrequired' event to the UI. This commit adds support for
this event to our recoding playback.
2018-08-16 15:36:43 +02:00
Samuel Mannehed 22000b93d5 Handle if desktopName isn't set when connected
We can't guarantee that the desktopName event has been fired before the
connect event.
2018-08-16 13:33:35 +02:00
Samuel Mannehed a793df3d6d
Merge pull request #1118 from novnc/disabledragwhilescale
Turn off view drag when scaling
2018-08-16 10:31:09 +02:00
Samuel Mannehed 4ddcc7537f Merge enableDisableViewClip and updateViewClip
Makes the code easier to follow and makes sure that viewDrag is
properly disabled when scaling. Fixes #1110.
2018-08-16 10:29:01 +02:00
Samuel Mannehed 6d1c036e0c
Use macOS 10.13 for Safari tests
Safari 11 had a bug (#1125) which should be fixed in Safari 11.1 which comes with macOS 10.13.
2018-08-15 08:10:38 +02:00
Samuel Mannehed 3b7c47417e Move dragThreshold definition to util/
In order to avoid multiple declarations that has to be updated in the
case of future updates.
2018-08-10 11:24:09 +02:00
Samuel Mannehed b3ac94a978 Remove firebug comments
Firebug is discontinued and it's features are included in browser
development tools now a days.
2018-08-08 14:05:06 +02:00
Samuel Mannehed eebef339be Detail path to icon Makefile 2018-08-08 14:04:45 +02:00
Solly Ross ee3493c060 Add a record flag to launch.sh
Add the `--record` flag to launch.js, for easy recording when testing.
2018-07-30 11:07:33 -04:00
Samuel Mannehed 2bbd15ccaf Remove setViewDrag function
Unnecessary function only used in the toggle function above.
2018-07-30 10:46:41 +02:00
Samuel Mannehed 0b903af296 Remove unnecessary code
The enableDisableViewClip call in the fullscreen code didn't have any
effect and should have been removed when the special case for clipping
in IE and Safari fullscreen was removed in b18ef81.

The setViewDrag call claimed to disable view drag on UI state change.
The UI states are:

 init, connecting, connected, reconnecting, disconnecting, disconnected

The only state where the called function didn't immediately return was
"connected" and that's the only state where enabling view drag is
possible. Thus it could never have been enabled when changing to the
"connected" state.
2018-07-30 10:29:35 +02:00
Solly Ross cccf3b008a Fix perf/playback tool
Somewhere along the way, the refactors broke playback.js.  This fixes
the actual functionality, and makes its JS loading match that in
vnc.html.
2018-07-29 19:14:56 -04:00
Pierre Ossman 862967e089 Merge branch 'master' of https://github.com/patrakov/noVNC 2018-07-25 20:40:51 +02:00
Alexander E. Patrakov 599588fe5f Documented browser cache issue 2018-07-22 23:03:05 +08:00
Pierre Ossman f9b6d7665d Use newer macOS test machine for Travis 2018-07-16 13:46:48 +02:00
Pierre Ossman 7bcdbbc65b Stop transpiling karma tests
This runs our code in the same manner as it would be used if loaded
directly in the browser. Includes the same kind of fallback for older
browsers.
2018-07-16 13:32:35 +02:00
Pierre Ossman 800abf1277 Fix proper triggering of module fallback
We might be in the "interactive" readyState, which means that
DOMContentLoaded has already fired and we'll hang.
2018-07-13 15:57:24 +02:00
Pierre Ossman 9eaea86234 Don't stub out ES module imports
It is not allowed and only happens to work because babel doesn't
strictly follow the specification. It doesn't seem necessary for the
tests to run, so just remove it.
2018-07-13 15:57:24 +02:00
Pierre Ossman d131633471 Better currentScript fallback
The previous heuristic didn't work under all circumstances, so try
something more robust.
2018-07-13 15:57:24 +02:00
Pierre Ossman ae2e1ff7bd Move sinon to karma framework
This frees us from manual imports, and makes things less magical
as those aren't ES modules even if the code suggest that the are.
2018-07-13 15:57:24 +02:00
Juanjo Diaz 885363a373 Use the classic `function foo() { ... }` for top level functions or functions that depend on the scope 2018-07-12 19:06:57 +02:00
Juanjo Diaz 651c23ece3 Use fat arrow functions `const foo = () => { ... };` for callbacks
and any other function that is passed around and it's not a top level function
2018-07-12 19:06:57 +02:00
Juanjo Diaz 0e4808bf6f Use ES6 classes
Always use the shorthand notation if the function is a method of an object or class `{ foo() { ... } }` or `class bar { foo() { ... } }`
unless it's a callback in which case you a fat arrow function should be used `{ cb: () => { ... } }`
2018-07-12 19:06:57 +02:00
Pierre Ossman 67fefcf184 Merge branch 'cursor' of https://github.com/CendioOssman/noVNC 2018-07-11 13:39:37 +02:00
Pierre Ossman baa4f23ee5 Provide fallback cursor method
Some browsers don't support custom cursors, and there are cases
where the browsers refuse to show the cursor. Handle both of these
cases by letting the browser render the cursor via a floating
canvas.

This allows us to support a local cursor at all times.
2018-07-06 16:37:27 +02:00
Pierre Ossman 1073b60155 Sort vkeys table 2018-07-04 15:53:41 +02:00
Pierre Ossman 8acadd9e97 Merge branch 'fix/ie11-numpad5-compatibility' of https://github.com/vlastoun/noVNC 2018-07-04 15:53:30 +02:00
Henry Vindin 9700e3592b Fixes #1075
Rather than trying to pick a utility, we should be able to just use bash to check if a port is available or not.

We can probably assume bash is available due to the shebang declaring it.
2018-07-01 15:37:34 +10:00
Samuel Mannehed f90c2a6d4b Avoid TypedArray.slice() because of IE11 2018-06-15 12:00:43 +02:00
Samuel Mannehed d9814c06bf Use string assignment operator instead of concat()
The assignment operator is a lot faster.
2018-06-15 11:59:28 +02:00
Samuel Mannehed 4318c8cafd Use the correct slicing for rQshiftStr
This didn't result in any error however since slice() handles such
mistakes gracefully.
2018-06-15 11:56:56 +02:00
Samuel Mannehed 178b92d380 Add rQshiftStr unit test for large strings 2018-06-15 11:53:51 +02:00
Samuel Mannehed db9daa98a5 Avoid big strings on the stack
Previous code resulted in RangeErrors by potentially creating big
strings.

Fixes issue #1065
2018-06-14 16:59:52 +02:00
Samuel Mannehed 362bd5e3a2 Call rQshiftBytes to avoid code duplication 2018-06-14 16:51:29 +02:00
Samuel Mannehed e87b645b56 Remove typedArrayToString
We don't use PhantomJS anymore
2018-06-14 16:43:48 +02:00