Merge noVNC master#1
Open
AndrewSverdrup wants to merge 804 commits into
Open
Conversation
Avoid poking around in the internals and instead test what is actually sent out on the WebSocket.
This small object will not properly fake a Websock in more complex cases, so let's avoid it and create a real Websock instead.
The caller might hang on to the data for multiple calls, so we make sure the returned buffer might not get overwritten.
All of these functions should have units tests, even if they are fairly minimal.
Let's test the full final result instead of assuming specific internal calls.
This is extra important in the tests where we expect no changes to the display, as otherwise we can't tell the difference between success and a decoder that is simply waiting for more data.
We don't have to keep track of this much data between rects, so restructure things to make it more simple. This allows the JPEG parsing code to be a pure function which only depends on the input.
We don't need any full slice functionality, so let's change this to better march rQpeek8() and rQshiftBytes().
That is the modern way to handle operations that cannot complete immediately.
Use proper accessor functions instead of poking around in internal buffers.
Callers should be using rQwait() to ensure sufficient data is present, and not poke around in the internal buffering.
Callers should be properly aware of how much data they need, as they need to call rQwait() first to ensure the data is present.
Let's not duplicate this stuff when we have convenience functions.
We don't know how long the caller will hang on to this data, so we need to be safe by default and assume it will kept indefinitely. That means we can't return a reference to the internal buffer, as that will get overwritten with future messages. We want to avoid unnecessary copying in performance critical code, though. So allow code to explicitly ask for a shared buffer, assuming they know the data needs to be consumed immediately.
This is what we almost always want, and this makes it consistent with rQshift8() and rQshift16().
We are expected to preserve these and use them in our requests back to the server. We can't do that if we don't actually decode them correctly.
We don't know the server layout yet, so we can't preserve the screen id or flags yet at this point. Move it until after we've parsed everything.
Send real messages and avoid poking around in internals, as we weren't testing things correctly that way.
It takes too much time and can make the tests fail.
Makes for more robust and realistic tests.
There is no encoding/decoding in modern WebSockets, so let's clean up some of the old crud that no longer serves a purpose.
It's more robust to do this just before we need the space, rather than assume when the queue will be read and adjust things right after.
Callers shouldn't be poking around directly in to the send queue, but should use accessor functions like for the read queue.
Callers shouldn't have to deal with the internal buffering limits of Websock, so implicitly flush the buffer if more room is needed.
Our settings are not a fatal requirement, we can fall back on the default values if they can't be accessed. A scenario where we've seen this happen is when cookies are disabled in the browser. It seems localStorage is disabled along with cookies in these settings. So, lets log a message about the failure and otherwise silently continue in this case. Fixes issue #1577.
Don't crash if we can't use localStorage
This was an accidental copy error from inflator.js. The second argument to deflateInit() is the compression level, not the window bits. We have not strong opinions on an appropriate level, so stick to the default.
There is just one argument to inflateInit(). It is inflateInit2() that takes two arguments. Since this argument was never used, let's just remove it and keep the existing behaviour.
This should have been a part of commit 243d7fd
This should have been a part of commit 243d7fd
Add a new configuration option `keep_device_awake` to allow noVNC to stop the local display from going to sleep. This is especially useful with view-only sessions. This new option has been added to the configuration UI, making it easier for users to configure. When this option is changed at runtime, we will request/release the wake lock. We only hold the view lock while connected to a server. We will also attempt to reacquire the wakelock if we lost it due to a visibility change (the tab becoming inactive, or during the transition into/from fullscreen). All existing unittests have been run, and the change has been manually tested in Firefox 145. Additional tests will be added later.
Add an error state to the WakeLockManager state machine. This adds a transition that can be detected from tests (it otherwise serves no purpose, and the system immediatly transitions back into the released state).
Dispatch an event on each state transition inside the WakeLockManager. This gives the unit tests something to synchronise on, allowing us to write fast, flake-free tests.
Add tests to for both the `rfb` side (calling into the new wakelock code), and the new wakelock class (which tracks the desired state and how to get there).
I noticed a simple typo - "inoder rendering"
Add wakelock support
Translate to Ukrainian
Fix comment typo in display.js
We shouldn't be advertising these if we'd like people to stop using them.
Mainly to keep eslint happy with its new recommended rules. But it also makes the code more clear to not have unused stuff in it. The des code got a bit more refactoring since eslint was upset about the final "i++" as it was technically an unused assignment.
In preparation for horizontal control bar modes
Simplifies alignment. In preparation for horizontal control bar modes.
There's only one button in the group, and the wrapping div messed with the flex box layout
This issue has now been fixed in https://validator.w3.org/nu, see: w3c/css-validator#473
We can't compare with a new CustomEvent, lets check the call arguments instead. The field is also called "text".
Replace top-level await with then() in browser.js, due to a bug in chromium browsers. #2053
Update github actions to latest versions
This was missed when doing the 1.7.0 release.
This fixes failing tests on Safari.
Use macOS 26 runner instead of macOS 10.15
Enable attaching the control bar to top and bottom
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.