Commit Graph

76 Commits

Author SHA1 Message Date
pdlan f974b73137 Cleanup for the cryptographic algorithms that are not supported by SubtleCrypto 2023-01-20 05:54:00 -05:00
Pierre Ossman 12a7c6f0de Check for Android using userAgent
Modern Android systems seem to report "Linux" for navigator.platform, so
we can no longer rely on that.
2022-12-27 12:50:57 +01:00
Pierre Ossman a187821e4f Add OS checks for Android and ChromeOS 2022-12-27 12:50:57 +01:00
Pierre Ossman ee5e3c5fa3 Refine browser detection
Try to follow the principle outlined by Mozilla when detecting browsers
and engines.
2022-12-27 12:50:57 +01:00
Pierre Ossman 4a34ee4b1e Remove navigator check from browser tests
This is a fundamental object that should always be present.
2022-12-27 12:50:57 +01:00
Fredrik Kortetjärvi 90f120c139 Added none user select on the cursor
This is because, when double-clicking with the trackpad, it will not
highlight the mouse. And this only happened on the iOS but the decision
on adding it a normal user select comes from the other commits that it
looks like it elsewhere.
2022-12-14 13:47:01 +01:00
pdlan 19aa9ad6a3 Remove bigint-mod-arith.js 2022-04-05 02:40:47 -04:00
Paul Dumais e21ed2e689 Added support for Apple Remote Desktop authentication
Fixed eslint warnings

Fixing tests that failed

Added unit tests for ARD authentication

Fixed an issue with the ARD rfb version number in the unit tests

Fixed issue with username/password lengths

Username and password lengths are now capped at 63 characters each.  Improved code for sign bit on public key bytes.

UTF Encoder username and password before packing it

Change UTF encoding to encode the username and password before packing it to prevent it from being expanded beyond the allowed size.  Public key is truncated to proper key length.

Replaced forge with web crypto for ARD authentication

Changed the way in which the async methods are handled, added unit tests to verify ARD encryption output.

Update .eslintignore
2022-04-04 11:40:19 -04:00
Pierre Ossman 6a4c411976 Remove createEvent() fallbacks
We can now rely on proper constructors for our events.
2020-12-07 10:10:53 +01:00
Pierre Ossman 27496941a0 Remove createImageData() fallback
All our browsers should be new enough now that we can rely on the
ImageData constructor.
2020-12-07 10:10:53 +01:00
Pierre Ossman 5b5b747494 Remove many small, obsolete, old browser hacks
These are for browsers no longer supported anyway.
2020-12-07 10:10:53 +01:00
Pierre Ossman dccf6facdc Drop support for legacy Edge 2020-10-15 18:53:51 +02:00
Pierre Ossman c01eb5e74d Drop support for Internet Explorer 2020-10-15 18:53:51 +02:00
Pierre Ossman 484a9551d1 Handle quick Cursor detach after mouse up
This timer might fire after the Cursor object has detached from a DOM
element, causing crashes. This will likely not happen in real scenarios,
but the tests are quick enough to trigger this.
2020-06-25 14:37:21 +02:00
Pierre Ossman 48f15efa69 Compensate for visual viewport when moving cursor 2020-06-16 14:24:00 +02:00
Samuel Mannehed 32ed7c6724 Fake cursor position when using touch
With the new gestures we will simulate the cursor being in a different
location than any of the touch points. This is a bit too complex for the
Cursor class, so let's just explicitly tell it where we want the cursor
rendered.
2020-06-12 14:36:10 +02:00
Pierre Ossman 8be924c9d9 Add touch gestures for mouse emulation
Add several single and multitouch gestures to simulate various mouse
actions that would otherwise be impossible to perform.

This replaces the old system where you could select which mouse button
a single touch would generate.
2020-06-12 09:18:46 +02:00
Samuel Mannehed a7fe079f81 Standardize on camelCase in Logging 2020-05-31 23:37:29 +02:00
Andrey Trebler efd1f8a4f2 adds qualityLevel property to RFB class for updating JPEG quality level encoding on the fly 2020-02-28 13:14:19 +01:00
Niko Lehto 9575ded8da Add util for unsigned and signed int. conversion
Will be used in later commit in extended clipboard handling.
2020-02-17 11:29:40 +01:00
Juanjo Diaz 8394462356 Remove generated HTML by Cursor when it detaches 2020-01-23 11:58:16 +02:00
Samuel Mannehed 11ae8f0ef4 Add comment for browser and platform detection 2020-01-02 11:30:34 +01:00
Samuel Mannehed c32d4f3cd0 Add short description at the top of browser.js 2020-01-02 11:30:34 +01:00
Samuel Mannehed e52a278ed7 Properly detect scrollbar gutter
As a rule, instead of hard-coding a behavior on specific platforms we
should do dynamic detection.

This commit moves away from always hiding scrollbars on Android and iOS
and instead detects the rendered width of scrollbars in the browser.
2020-01-02 11:30:18 +01:00
Samuel Mannehed 2cf82a5c8e Build in the behavior to ignore decodeUTF8 errors
Makes the code clearer and more explicit in intent.
2019-12-23 10:27:40 +01:00
Samuel Mannehed 80b078c469 Add encodeUTF8 function to core/util/strings.js 2019-12-04 10:37:11 +01:00
Pierre Ossman 9f557f5280 Make Cursor.detach() safe to call when not attached
Avoids having checks in higher layers.
2019-11-29 10:08:15 +01:00
Samuel Mannehed 0c4b3e802f Rename document.capturedElem to captureElement
To better fit most naming.
2019-10-23 15:59:43 +02:00
Samuel Mannehed c3a7524c9e Hide the emulated cursor when target is null
Makes it easier to understand what happens when a real element isn't
passed as a target to updateVisibility(). Also makes the code more
robust to future changes.

Co-authored-by: Alex Tanskanen <aleta@cendio.se>
Co-authored-by: Niko Lehto <nikle@cendio.se>
2019-10-21 13:51:42 +02:00
Samuel Mannehed 7a96fc3785 Fix disappearing cursor after click
In the cursor emulation when deciding if the cursor should be hidden -
Instead of checking what's under the cursor, we check the element that
has capture.

This introduced another bug in the cursor emulation. The cursor did not
always disappear properly when using our cursor emulation together with
our setCapture polyfill. More specifically, we saw a problem when a
capture ended on an element without cursor emulation.

We solved this by introducing another visibility check on a timer in
the cursor emulation. However this led to yet another problem where
this timer conflicted with the timer in the setCapture polyfill.

We removed the timeout in the setCapture polyfill and created a
variable to make sure that all the events remaining in the queue can be
completed.

Co-authored-by: Alex Tanskanen <aleta@cendio.se>
Co-authored-by: Niko Lehto <nikle@cendio.se>
2019-10-21 13:51:42 +02:00
Samuel Mannehed 938690375b Check next elem at mouseleave in cursor emulation
It's not obvious that we want to hide the cursor when we get a leave,
it depends on the element that we're leaving to. This makes the code
more robust.

Co-authored-by: Alex Tanskanen <aleta@cendio.se>
Co-authored-by: Niko Lehto <nikle@cendio.se>
2019-10-21 13:10:13 +02:00
Samuel Mannehed fcd99d04fb Rename variables in setCapture proxy
The names of many variables were too similar. To make the code easier
to follow we renamed:

* _captureElem to _capturedElem
* _captureElemChanged() to _capturedElemChanged()
* captureElem to proxyElem
* elem to target

Co-authored-by: Alex Tanskanen <aleta@cendio.se>
Co-authored-by: Niko Lehto <nikle@cendio.se>
2019-10-21 13:10:09 +02:00
Samuel Mannehed 412d93060d Update copyright to 2019 for modified files 2019-09-30 15:35:33 +02:00
Niko Lehto a1afb2a215 Fix url cursor detection on Edge
_supportCursorURIs was set to true even when Edge didn't support
URIs because the fallback value "default" was used.
2019-09-23 13:50:17 +02:00
Juanjo Diaz 41ddb35458 Replace unnecessary function supportsCursorURIs by a constant variable 2019-02-27 10:14:50 +02:00
Juanjo Diaz 44f4c5545f Move support check from display to browser 2019-02-27 10:13:50 +02:00
Juanjo Diaz 667f3cc20e Remove unnecessary context from eventtarget 2019-02-26 23:51:45 +02:00
Juanjo Diaz fe5974a740 Remove unnecessary constructor parameter from Cursor 2019-02-26 23:51:33 +02:00
Pierre Ossman 47c66517ae Throw correct Error object
We've already defined the name Error as a logging function, so we
need to be more explicit when we want to refer to the exception
class.
2019-02-15 13:01:28 +01:00
Samuel Mannehed ef64917a90 Only disable scrollbars on Android and iOS
Previously scrollbars were disabled on all touch devices. This meant
that they were disabled on Windows when touch was detected. Windows does
in fact have useful scrollbars even in touch mode. Fixes Issue #1172
2019-01-09 14:59:22 +01:00
Samuel Mannehed 47b3eac82b Move UI.isSafari into core/util/browser.js
This is where the rest of these kinds of functions are.
2019-01-09 14:58:03 +01:00
Samuel Mannehed 97e23ebbb2 Reorder browser and platform info functions
Platform info functions grouped together and browser info functions
grouped together.
2019-01-09 14:56:59 +01:00
Juanjo Diaz 11ef53544f Simplify EventTargetMixin 2018-11-25 13:53:23 +02:00
Solly Ross 84586c0f17 Change copyright header (#1138)
* Change copyright header

This updates the copyright header to say "The noVNC Authors".  People
who previously had copyright listings are now under the AUTHORS file.
2018-10-09 12:15:35 +02:00
Pierre Ossman 9881899e7b Merge branch 'style' of https://github.com/CendioOssman/noVNC 2018-09-17 13:54:04 +02:00
Alexander E. Patrakov d1314d4b3a Moved the "pixels + mask -> RGBA" logic to rfb.js
As requested by Pierre Ossman - he needs this for supporting other
cursor extensions.
2018-09-07 23:01:46 +08:00
Pierre Ossman 2c5491e131 Enforce space after function name 2018-09-06 17:34:15 +02:00
Pierre Ossman 0ae5c54ab3 Enforce explicit semi-colons 2018-09-06 17:25:02 +02:00
Pierre Ossman 426a8c927b Enforce curly braces for control statements 2018-09-06 17:22:40 +02:00
Pierre Ossman 942a312779 Enforce object key spacing 2018-09-06 17:07:11 +02:00