- From: Zgroza (Luke Klimek) <notifications@github.com>
- Date: Mon, 29 Sep 2025 07:57:21 -0700
- To: w3c/clipboard-apis <clipboard-apis@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/clipboard-apis/pull/239/review/3280321966@github.com>
@zgroza commented on this pull request. > @@ -224,12 +227,166 @@ url: https://w3c.github.io/permissions/#permissions-task-source; type: dfn; * Scripts that use the [[#async-clipboard-api]] to write to the clipboard * Actions that update the clipboard outside the user agent - If the clipboard contents are changed outside the user agent, then the - {{GlobalEventHandlers/clipboardchange}} event MUST fire when the user agent regains focus. + <div class="algorithm" data-algorithm="fire-clipboardchange-event"> + <h5 id="h-fire-clipboardchange-event">To fire a clipboardchange event</h5> + + To <dfn export>fire a clipboardchange event</dfn> given a {{Document}} <var>document</var>: + + 1. If <var>document</var> does not have [=sticky activation=] and <var>document</var> does not have permission to read from the clipboard, then return. + + 2. Let <var>global</var> be <var>document</var>'s [=relevant global object=]. + + 3. If <var>document</var> has [=system focus=]: + 1. Let <var>types</var> be a list of [=mandatory data types=] available on the [=system clipboard=]. + 2. Let <var>changeId</var> be a unique identifier for this clipboard change, generated by applying a partition-specific transformation to a system-level clipboard change identifier, ensuring that different [=partitions=] receive different identifiers for the same clipboard change while maintaining consistency within the same [=partition=]. Hm, after thinking about this a bit more—there is a similar problem with the [extra permission data](https://webbluetoothcg.github.io/web-bluetooth/#note-device-id-tracking) of the Web Bluetooth API. There this is handled through a [non-normative section](https://webbluetoothcg.github.io/web-bluetooth/#remote-device-identifiers) with similar recommendations for user agents. Maybe we can do something like that here to avoid overcomplication, potentially with a short normative provision about what *not to* do? Then we could just have something like this: ``` Let changeId be a unique identifier for this clipboard change. User agents MUST NOT deliver the same changeId value to documents associated with different local storage shelves and MUST deliver the exact same changeId value to all documents associated with the same local storage shelf. ``` and a non-normative section on the privacy recommendations and potential implementations below. The benefit would also be that this would ensure that the behavior be the same across browsers without forcing implementers to do this in any particular way (ex. hashing against the stored salt, random generation on every dispatch, even maybe hashing against the hardware address of the begin of the local storage shelf, ...). -- Reply to this email directly or view it on GitHub: https://github.com/w3c/clipboard-apis/pull/239#discussion_r2388295422 You are receiving this because you are subscribed to this thread. Message ID: <w3c/clipboard-apis/pull/239/review/3280321966@github.com>
Received on Monday, 29 September 2025 14:57:24 UTC