GitHub user mike-jumper opened a pull request:

    https://github.com/apache/incubator-guacamole-client/pull/185

    GUACAMOLE-310: Fix clipboard handling of newlines.

    As reported in 
[GUACAMOLE-310](https://issues.apache.org/jira/browse/GUACAMOLE-310), newlines 
are being stripped from clipboard data copied using the [W3C Clipboard 
API](https://www.w3.org/TR/clipboard-apis/). This makes clipboard use 
cumbersome for users where the browser provides direct integration of the 
clipboard, such as IE11 or Chrome with the [Clipboard Permission 
Manager](https://chrome.google.com/webstore/detail/clipboard-permission-mana/ipbhneeanpgkaleihlknhjiaamobkceh)
 extension.
    
    This is due to newlines being stripped from `textContent` of a `<div>` 
despite `white-space: pre` being set. As this did indeed work before, this 
seems to be a recent browser behavior change. By reverting back to using a 
`<textarea>` the clipboard event target, newlines work as expected.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mike-jumper/incubator-guacamole-client 
fix-clipboard

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-guacamole-client/pull/185.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #185
    
----
commit 535b70fdce8ff5df2405e23b30897f65ecda66bf
Author: Michael Jumper <[email protected]>
Date:   2017-08-29T18:38:05Z

    GUACAMOLE-310: Switch clipboard service back to using textarea for contents.

commit cc22f23c027bc4dd688eb71372c90a7b31e71e40
Author: Michael Jumper <[email protected]>
Date:   2017-08-29T18:39:08Z

    GUACAMOLE-310: Ensure clipboard service target remains hidden (1x1 px may 
be below browser's minimum dimensions for a textarea).

commit 47acaf5b41c911d402a9f242cc58619bc74c4cb9
Author: Michael Jumper <[email protected]>
Date:   2017-08-29T18:39:49Z

    GUACAMOLE-310: Wait until clipboard target is actually focused before 
attempting paste.

commit 7e0cdd2adf156b6aa15ddf96a7e78a41c8f47c9a
Author: Michael Jumper <[email protected]>
Date:   2017-09-04T00:07:24Z

    GUACAMOLE-310: Use input element select() function when available.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to