Commit Graph

2486 Commits

Author SHA1 Message Date
Adam Halim e8602f23ab Move sendFbuMsg() to broader scope
This is needed if we want to use this function elsewhere in our tests.
2025-01-14 16:27:14 +01:00
Pierre Ossman 9cdbd28761 Merge branch 'mouse-buttonstate-remove' of https://github.com/CendioHalim/noVNC 2025-01-14 12:56:19 +01:00
Adam Halim 6383fa6384 Flush mouseMove when initiating viewport dragging
We want to flush pending mouse moves before we initiate viewport
dragging.

Before this commit, there were scenarios where the _mouseButtonMask
would track a released button as being down.
2025-01-14 12:32:51 +01:00
Adam Halim d1548c12ec Don't send mouse events when dragging viewport
We don't want to send any mouse events to the server when dragging the
viewport. Instead, we treat them as a client-only operation.
2025-01-14 12:14:59 +01:00
Adam Halim b9230cf23e Use MouseEvent.buttons for button state tracking
Instead of keeping track of button states ourselves by looking at
MouseEvent.button, we can use the MouseEvent.buttons which already
contains the state of all buttons.
2025-01-14 12:14:59 +01:00
Adam Halim f9eb476f6d Add tests for dragging with gestures
There were no test for viewport dragging using gesture previously, so
let's add some.

Note that there currently are some viewport dragging behaviours that we
don't want to have, so some tests have commented out what our desired
behaviour should be.
2025-01-14 12:14:59 +01:00
Adam Halim ea057d0793 Move gesture event help functions to broader scope
This is needed if we want to test gestures with dragging.
2025-01-14 12:14:59 +01:00
Adam Halim 31d6a77af6 Check for correct button events in dragging tests
Previously, these unit tests did not check which events were sent to the
server, only how many events were sent. This commit adds checks to see
that the expected button events are sent.
2025-01-14 12:14:59 +01:00
Adam Halim dce8ab395b Dispatch mouse events in dragging unit tests
This makes our tests reflect the real world better, as we now send real
mouse events instead of calling private methods directly.
2025-01-14 12:14:59 +01:00
Adam Halim c3934e0938 Move mouse move flushing to separate function 2025-01-14 12:14:34 +01:00
Adam Halim db22ec6ee6 Split button click with dragging test 2025-01-14 10:38:39 +01:00
Adam Halim de9d6888db Add unit test for wheel + buttons pressed 2025-01-14 10:38:39 +01:00
Adam Halim 7a4d1a8274 Move mouse event help functions to broader scope
These functions can be used elsewhere in the tests. We want to use these
in the dragging tests in the future instead of directly calling private
methods.
2025-01-14 10:38:39 +01:00
Samuel Mannehed 3193f808b5 Comment different resize functions in rfb.js 2024-12-27 14:48:20 +01:00
Samuel Mannehed e6e03a226f Fix resizes back to initial remote session size
Since the expected client size wasn't updated when the browser window
resized, noVNC didn't resize the canvas properly when going back to
the exact same dimensions.

Fixes issue #1903
2024-12-27 14:48:11 +01:00
Pierre Ossman 673cb349fd Replace po2json with pofile
The former doesn't seem to be properly maintained and nodejs gives
deprecation warnings.
2024-12-17 17:15:14 +01:00
Pierre Ossman 3e2e04bea1 Replace node-getopt with commander for args
node-getopt isn't maintained and nodejs has started complaining about
deprecated features in it.
2024-12-17 16:44:21 +01:00
NNN1590 52392ec150
Update Japanese translation 2024-12-14 15:59:01 +09:00
Pierre Ossman 52ddb20d25 Merge branch 'master' of https://github.com/wxtewx/noVNC 2024-11-27 16:12:05 +01:00
Pierre Ossman 7335bb440d Also adjust to "sentence case" in translations
This would have resolved itself automatically on the next translation
update, but this commit will reduce unnecessary noise in that change.
2024-11-27 16:04:18 +01:00
Pierre Ossman 7f5b51acf3 Consistently use "sentence case" style
Try to be more consistent in how we capitalize things. Both the "Title
Case" and "Sentence case" styles are popular, so either would work.
Google and Mozilla both prefer "Sentence case", so let's follow them.
2024-11-27 14:40:40 +01:00
wxtewx 90a6c7bbb6
Update zh_CN.po 2024-11-23 15:36:12 +08:00
Pierre Ossman 2463ccd08f Detect broken Firefox H.264 decoder
The Firefox H.264 decoder on Windows might simply just refuse to deliver
any finished frames. It also doesn't deliver any errors.

Detect this early by expecting a frame after flush() has completed.
2024-11-21 13:33:52 +01:00
Pierre Ossman a89dfd6141 Handle exceptions from VideoDecoder.flush()
These are not supposed to happen according to the specification, but
Firefox has some bug and throws them anyway.
2024-11-21 13:33:32 +01:00
Pierre Ossman 3677afe305 Do a real H.264 test decode to determine support
Firefox is buggy and reports support for H.264 but then throws errors
once we actually try to decode things. Detect this early by doing a
quick test decode of a single frame.
2024-11-21 13:33:31 +01:00
Pierre Ossman 69750c74a6 Raise JavaScript version requirement
So that we can use await at module top level.
2024-11-21 13:33:10 +01:00
Pierre Ossman 89e0591aab Use common H.264 check in tests
Avoid duplicating this logic in multiple places.
2024-11-21 13:19:44 +01:00
Pierre Ossman 43326eb67b Fix handling of VideoDecoder.isConfigSupported()
It returns an object with details, not just a simple boolean.
2024-11-20 10:46:52 +01:00
dim5x 88a5a59629 Fix typos in Russian translation 2024-11-02 04:38:57 +03:00
Pierre Ossman ed1fef4fc3 Merge branch 'ui_init' of github.com:CendioOssman/noVNC 2024-10-09 13:12:33 +02:00
Pierre Ossman 28d4020302 Load settings from web server
Make it even easier to customize things by loading the settings from
separate configuration files.
2024-10-03 16:08:53 +02:00
Pierre Ossman 438e5b3608 Make it easier for downstream to modify settings
Expose a simple and stable API to override default settings, and force
settings that users shouldn't be able to change.
2024-10-03 16:08:53 +02:00
Pierre Ossman 047531e886 Merge branch 'webcodec-h264' of https://github.com/any1/noVNC 2024-08-29 16:59:25 +02:00
Pierre Ossman 50e4685bff Fix tests for large WebSocket sends
These failed to test that the data was correctly split as they only
checked the first chunk transmitted.

Use random values to avoid the risk of aligning our test data with the
split boundaries and hence allowing false positives.
2024-08-29 16:51:51 +02:00
Pierre Ossman ffb4c0bf56 Let fake WebSocket handle large sends
Dynamically grow the recorded send buffer if the test needs to send a
lot of data.
2024-08-29 16:51:16 +02:00
Tomasz Kalisiak a4465516df
Fix sQpushBytes sending the beginning of the array multiple times 2024-08-23 13:14:36 +02:00
Andri Yngvason c1bba972f4 Add unit tests for H.264 decoder 2024-08-19 22:08:32 +00:00
Pierre Ossman bbb6a5b938 Fix host and port via query string
We need to call initSetting() even if we don't have any interesting
default to set, as that is what checks if values have been provided as a
query string.

Fixes 96c76f7.
2024-08-19 14:01:00 +02:00
Andri Yngvason d106b7a6bb Add H.264 decoder
This adds an H.264 decoder based on WebCodecs.
2024-08-18 14:06:25 +00:00
Mark Peek c6c8e5e513 Add Zlib encoding 2024-08-16 09:12:43 -07:00
Pierre Ossman 84897fd110 Handle disabling settings without label 2024-08-08 15:59:59 +02:00
Pierre Ossman c6606a5caf Merge UI startup in to a single routine
Makes it easier to see how things are connected.
2024-08-08 15:59:58 +02:00
Pierre Ossman 9334c68241 Handle all settings via UI.getSetting()
Makes sure everything behaves the same way, even if there is no visible
UI for a settings.
2024-08-08 15:00:48 +02:00
Pierre Ossman 96c76f7709 Allow relative WebSocket URLs
This can be very useful if you have multiple instances of noVNC, and you
want to redirect them to different VNC servers.

The new default settings will have the same behaviour as before for
systems where noVNC is deployed in the root web folder.
2024-08-08 14:53:42 +02:00
Pierre Ossman 074fa1a40f Let browser construct URL string for us
Likely a lot safer for corner cases than us trying to figure this out
ourselves.
2024-08-08 14:40:04 +02:00
Pierre Ossman 06f14a5cd3 Add test for AltGr abort on blur 2024-08-05 16:31:59 +02:00
Pierre Ossman a020ef0f44 Merge branch 'altgr-seq-interrupt' of https://github.com/leedagee/noVNC 2024-08-05 16:30:47 +02:00
Pierre Ossman 1b2fe3321b Manually load sinon and chai
karma-sinon-chai is not compatible with Chai 5+, and Karma is no longer
being updated.

Load sinon and chai manually instead, until we can have a long term plan
in place.
2024-08-05 15:49:39 +02:00
Pierre Ossman bc31e4e8a2 Stop creating sinon sandbox early
sinon might not be loaded at this point, which can cause tests to fail.

We could create the sandbox in one of the hooks instead, but let's
remove the sandbox completely to stay consistent with our other tests.
2024-08-05 15:45:41 +02:00
leedagee 6c07136169 Interrupt AltGr sequence detection on focus lost, fixes #1880 2024-08-01 01:31:47 +08:00