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

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

Yes, it could potentially be a good idea to skip self-initiated writes. But it can be a bit nontrivial, as:
* As @annevk mentioned, what do we mean by "self"? Probably the answer would be along the lines of "all the documents that would receive the same `changeId`—so all that share the same local storage shelf". Otherwise, all the other tabs would get the event with a new, yet-unknown `changeId`, defeating the whole purpose.
* I'm not sure whether it's even possible on all platforms to reliably track whether the current clipboard contents originated from our application or not.

But I wonder, is the simplest javascript solution—making site's first `clipboardchange` handler call after calling `write()` back up the new `changeId` without syncing clipboard to remote—not sufficient? Because I fear that all possible browser-side solutions to that problem would essentially use the same mechanism.

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

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

Received on Wednesday, 15 October 2025 15:36:51 UTC