Changed underlying socket to _rawChannel instead of _webChannel. Reverted some log statements to use more public facing Connection word rather than the internal api WebChannel word. Reverted log usage of underyling channel type (rtc or websocket) to class name WebChannel instead.
* origin/master:
Fix focus problem after closing the toolbar
Set a default value for the quality input
Add UI for quality setting
adds qualityLevel property to RFB class for updating JPEG quality level encoding on the fly
Hide clipboard side bar button when view only mode
Fix crash with too large clipboard data
Style all input types for consistent UI
Add extended clipboard Pseudo-Encoding
Export constants in inflate.js for easier usage
Fix bug where inflate would read too much data
Split api of inflate
Handle errors from zlib/pako
Move error handling to Inflate class
Add missing copyright header for Inflator.js
Remove unused inflate argument
Add util for unsigned and signed int. conversion
Add deflator helper class for deflating data
Make clipBoardPasteFrom() test more specific
Correcting path to package.json for running at a path other than root.
If too much text is copied in the session, String.fromCharCode.apply()
would crash in Safari on macOS and Chrome on Linux. This commit fixes
this issue by avoiding apply() altogether. Also added test to cover this
issue.
The main change is to the connect() method which now checks the urlOrChannel variable to determine which arguments to pass to WebChannel.open. The url case remains largely the same, we simply check that it is of type string. If a WebSocket or RTCDataChannel is passed, we use the object prototypes constructor name to determine the type of the instance variable provided is one which we expect and then forward it on to WebChannel.open, along with the name so we dont have to do the same work in WebChannel. We use Object.getPrototypeOf because accessing the __proto__ directly is not recommended.
The name WebChannel was chosen to represent the opaque datachannel used, either WebSocket or RTCDataChannel. The open method was refactored to take an object of uri and protocols or webChannel and channelType. We introduce a channelStates enum and helper method that provides compatible states across WebSocket and RTCDataChannel. Call sites for logging are refactored to list the channelType (WebSocket or RTCDataChannel) to be more descriptive.
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.
Internet Explorer seems to flag images as loaded prematurely, which
can result in rendering bugs. We can detect this by looking at the
dimensions though.
Caps Lock on iOS only trigged key release or key press events.
When it's clicked it would only send keydown, and next time
it would only send keyup and so on. It should send both a key press
and a key release.
Also added the unit tests for macOS since those were missing.
Co-Authored-By: Alex Tanskanen <aleta@cendio.se>
There is no obvious choice what works best here, but this is what
TigerVNC has been doing for years without complaints. Let's follow
them until we get reports that this doesn't work well.
The standards have unfortunatly caused some confusion between the Windows
key and the original Meta key. Try to handle the common case sanely at least.