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

Clipboardchange event API #186

Open
roraja opened this issue Nov 19, 2024 · 4 comments
Open

Clipboardchange event API #186

roraja opened this issue Nov 19, 2024 · 4 comments

Comments

@roraja
Copy link

roraja commented Nov 19, 2024

Introduction

The clipboardchange event fires whenever the system clipboard contents are changed. This allows web-apps like remote desktop clients to be notified and respond to changes to the system clipboard. It provides an efficient alternative to polling the clipboard for changes.

Read the complete Explainer.

Feedback (Choose One)

Please provide all feedback below.

I welcome feedback in this thread, but encourage you to file bugs against the Explainer.

@amitavak
Copy link

In Excel Web, the "Clipboard Change Event API" will enhance the user experience, aligning it with the capabilities of Excel Desktop. This feature has been anticipated for some time, as it is an integral part of the clipboard specification.

@garykac
Copy link
Member

garykac commented Dec 4, 2024

We would certainly make use of this for our Remote Desktop web client.

The usage scenario that we have is needing to detect local clipboard changes so that we can send them to the remote machine, where the user expects to be able to paste (remotely) the content they just copied (locally).

Simply checking the clipboard for changes whenever the user interacts with is not great because:

  • we have to access the clipboard constantly (whenever there's interaction) in case it needs to be pasted
  • we either have to delay the interaction or we have a potential race between sending the clipboard contents and the user interaction to the remote machine.

We currently have to rely on heuristics and polling to detect clipboard changes, so an event would be very helpful for this case.

@shruthiuctx
Copy link

This would be a great value addition for Citrix's web based solutions.
The clipboardChange event simplifies the detection of local device clipboard changes and gives an efficient way to keep the local device and remote server's clipboard in sync. Otherwise this needed polling mechanism to be implemented to detect the clipboard changes which is not performant.

This gives a great start and having an addition of identifier to each clipboard change in the event's payload makes it more performant. This would be beneficial to decide if a clipboard update is relevant for further processing or can be eliminated as redundant update on the window focus especially when user has multiple remote server sessions.

@jyasskin
Copy link
Member

Given the specification for this in https://w3c.github.io/clipboard-apis/#eventdef-globaleventhandlers-clipboardchange, has the Web Editing WG already adopted it? If so, you should move the explainer into https://github.com/w3c/clipboard-apis, and you don't need a new WICG incubation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants