Skip to content

Investigate the possibility of improving ClipboardService usage #6209

Open
@azatsarynnyy

Description

@azatsarynnyy

Description

This is the follow-up issue for the PR #5994.

There're two problems with the BrowserClipboardService impl which relies on Async Clipboard API for accessing the system clipboard:
1/ It works only for localhost and for the pages, loaded over https. But for non-secure http pages, it's prohibited due to the security concerns.
2/ It works well in Chrome but it requires performing additional steps in FireFox to unlock Async Clipboard API. One needs to enable API through the dom.events.testing.asyncClipboard preference. See the PR #5994 description for the details.

It looks like BrowserClipboardService needs to use both Async Clipboard API and document.execCommand API to work properly for the different cases.

Note, FF requires calling document.execCommand('cut'/'copy') inside the short-living event handlers of user actions like mouse click, keypress etc. See #5994 (comment) for the details. So it won't work when a plugin calls it through env.clipboard plugin API.

Also:

TerminalCopyOnSelectionHander has to be replaced with ClipboardService and copy on select for terminals has to be tested as a part of this issue

see #6536 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    clipboardissues related to the clipboardcoreissues related to the core of the applicationhelp wantedissues meant to be picked up, require help

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions