- From: Gaurang Tandon <notifications@github.com>
- Date: Wed, 28 Oct 2026 10:40:58 -0700
- To: w3c/clipboard-apis <clipboard-apis@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/clipboard-apis/issues/255@github.com>
GaurangTandon created an issue (w3c/clipboard-apis#255)
**Browser inconsistency**
- In a 'paste' event listener, Chrome (and Safari) allows reading the contents of event.clipboardData _after_ a microtask await. Firefox does _not_ allow it.
- Had filed (old) crbug for this: https://issues.chromium.org/issues/40913972
- In the 'drop' event listener, all three browsers allow reading the contents of event.clipboardData _after_ a microtask await.
**Spec**
[The spec for clipboard events](https://www.w3.org/TR/clipboard-apis/#privacy-events) states the following. It suggests that Firefox's more conservative behavior for 'paste' is probably correct.
> - Objects implementing the `[DataTransfer](https://html.spec.whatwg.org/multipage/dnd.html#datatransfer)` interface to return clipboard data _must not_ be available outside the ClipboardEvent event handler that the data is provided to.
> - If a script stores a reference to an object implementing the `[DataTransfer](https://html.spec.whatwg.org/multipage/dnd.html#datatransfer)` interface to use from outside the ClipboardEvent event handler, all methods _must_ be no-ops when called outside the expected context.
[The spec for DND event](https://html.spec.whatwg.org/multipage/dnd.html#the-dragevent-interface) states the following. It's not clear to me whether this allows or disallows reading the contents after a microtask.
> Dispatch event at the specified target element.
> Set the drag data store allowed effects state to the current value of dataTransfer's effectAllowed attribute. (It can only have changed value if e is dragstart.)
> If dataDragStoreWasChanged is true, then set the drag data store mode back to the protected mode.
> Break the association between dataTransfer and the drag data store.
**Impact**
This leads to developer confusion and cross-browser bugs, like here: https://github.com/strictdoc-project/strictdoc/issues/3254
**Notes**
This issue is related but stale: https://github.com/w3c/clipboard-apis/issues/50
--
Reply to this email directly or view it on GitHub:
https://github.com/w3c/clipboard-apis/issues/255
You are receiving this because you are subscribed to this thread.
Message ID: <w3c/clipboard-apis/issues/255@github.com>
Received on Wednesday, 28 October 2026 17:41:02 UTC