Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUACAMOLE-1678: Fix the typing issue in the clipboard text in some cases. #945

Open
wants to merge 1 commit into
base: patch
Choose a base branch
from

Conversation

myjimmy
Copy link
Contributor

@myjimmy myjimmy commented Jan 17, 2024

Fixed the typing issue in the clipboard text in some cases.

@necouchman
Copy link
Contributor

@myjimmy I have some concerns with these changes...

  • It's unclear to me why removing the pushSelection() and popSelection() calls fixes the issue described in the Jira ticket? From that, it sounds like this is only an issue on insecure (HTTP://) connections, and others work fine. Why is this particular change necessary to solve that issue?
  • Based on the comments around the changes, it seems like the blur was intentionally added for mobile browsers - is it really the push/pop that needs to be removed, or does the blur need to be handled differently (maybe only on mobile browsers)?
  • Do these changes have any other impacts to other platforms - particularly the mobile ones mentioned in the comments around this section?

@necouchman
Copy link
Contributor

@myjimmy Sorry, I see that you addressed many of these on the Jira ticket. You mentioned, there, that the push/pop functionality was added to support non-text clipboard contents, which Guacamole currently doesn't support - I guess I want to make sure that this really was (supposed to be) fully removed and that these changes don't have any adverse impacts on other clients before pull those calls out.

Also, if those things were added for the purpose of supporting non-text clipboard data, presumably at some point in the future we will want to re-add that support, so not sure if this will become an issue, again, when we go to do that?

@myjimmy
Copy link
Contributor Author

myjimmy commented Jan 17, 2024

It's unclear to me why removing the pushSelection() and popSelection() calls fixes the issue described in the Jira ticket? From that, it sounds like this is only an issue on insecure (HTTP://) connections, and others work fine. Why is this particular change necessary to solve that issue?

@necouchman The Asynchronous Clipboard API is available only but in secure contexts (HTTPS) also in some of browsers.
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility

Based on the comments around the changes, it seems like the blur was intentionally added for mobile browsers - is it really the push/pop that needs to be removed, or does the blur need to be handled differently (maybe only on mobile browsers)?

Because the removed code is related to only the clipboard of the non-text content, it have no relation to the blur() and focus() functions.
The blur() and focus() functions are called for performing the deprecated clipboard command.

Do these changes have any other impacts to other platforms - particularly the mobile ones mentioned in the comments around this section?

I think that these changes have no impacts to other platforms.
I've tested my fix on some kinds of mobile devices (iphone, android) and browsers (firefox, chrome, safari).
It works well.

@mike-jumper
Copy link
Contributor

The pushSelection() and popSelection() functions are not specific to support for images - they prevent the current selection state within the browser from being clobbered by the call to selectAll() that has to occur before we invoke document.execCommand().

From the description of GUACAMOLE-1678 and the nature of these changes, it sounds like manipulating the selection state is having unintended side effects, but I'm skeptical that simply removing pushSelection(), etc. is correct. I would be concerned that this introduces other strange selection behavior.

@mike-jumper mike-jumper deleted the branch apache:patch April 5, 2024 17:34
@mike-jumper mike-jumper closed this Apr 5, 2024
@mike-jumper mike-jumper reopened this Apr 7, 2024
@mike-jumper mike-jumper changed the base branch from staging/1.5.5 to patch April 7, 2024 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants