Re: [w3c/clipboard-apis] `changeId` interaction between `clipboard.write` and `clipboardchange` (Issue #243)

jamiewalch left a comment (w3c/clipboard-apis#243)

A custom mime type solves this problem quite neatly; thanks for the suggestion. The type needs to be prefixed with `web ` to work with Chrome (for example, `web application/x-my-type`), per https://developer.chrome.com/blog/web-custom-formats-for-the-async-clipboard-api.

> 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".

I had the same concern, which is the main reason I don't love the idea of suppressing such notifications. Perhaps the spec or explainer could document the use of custom web formats for applications that want to implement their own suppression?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/clipboard-apis/issues/243#issuecomment-3408237783
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/clipboard-apis/issues/243/3408237783@github.com>

Received on Wednesday, 15 October 2025 20:54:32 UTC