- From: roraja <notifications@github.com>
- Date: Wed, 15 Oct 2025 12:46:32 -0700
- To: w3c/clipboard-apis <clipboard-apis@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/clipboard-apis/issues/243/3408005943@github.com>
roraja left a comment (w3c/clipboard-apis#243) Agree with the points above. Also for this scenario, can we rely on custom mime types in clipboard ? When client updates clipboard with remote contents, along with setting the data for say text, html, etc, it can also set a web application generated ID called "lastSelfClipboardID" in a custom mime type like "web remotedesktop/lastSelfClipboardID". The web app can store this "lastSelfClipboardID" locally (and share with same pages within the partition). Upon the next clipboardchange (triggered by clipboard.write), the web app can check for presence of this custom mime type, compare the lastSelfClipboardID locally with the clipboard's value of the same id. If they are same, web app can infer that this clipboard data was the self written one and ignore forwarding to remote and can optionally update the changeID locally for any future comparisons. I am not sure if all browsers support custom mime types today but this can be one way to track locally written changes. As a side note, not delivering clipboardchange on self initiated clipboard writes might have following problem. Suppose a large and modular single page application has a component writing clipboard using clipboard.write but another independent component listening to clipboardchange to say update a UI where the clipboard history is shown. The component in the same page would expect 'clipboardchange' to be fired in every case regardless of the source of clipboard change. Also, if we add this exception, the name "clipboardchange" becomes somewhat confusing to developers since its not really "clipboardchange" but "externalclipboardchange". -- Reply to this email directly or view it on GitHub: https://github.com/w3c/clipboard-apis/issues/243#issuecomment-3408005943 You are receiving this because you are subscribed to this thread. Message ID: <w3c/clipboard-apis/issues/243/3408005943@github.com>
Received on Wednesday, 15 October 2025 19:46:36 UTC