[w3c/clipboard-apis] Interoperability issue: `navigator.clipboard.write()` and `navigator.clipboard.writeText()` user gesture requirement (Issue #182)

(This was brought up in the context of @simevidas' [tweet](https://twitter.com/simevidas/status/1557626100972404736).)

When attempting to write to the clipboard via either of `navigator.clipboard.write()` or `navigator.clipboard.writeText()` , both **Safari** 🚫 and **Firefox** 🚫 require a user gesture:

![image](https://user-images.githubusercontent.com/145676/184145734-0478c5c0-c299-475b-8dcf-d4fda33a54ea.png)

In contrast, and this is the interoperability issue I guess, **Chrome** ✅ happily proceeds. **Brave**, based on Chromium, considered disabling this behavior (https://github.com/brave/brave-browser/issues/16890).

One use case requiring a user gesture would break is that of remote clipboard synchronization, which is [explicitly mentioned in the spec](https://w3c.github.io/clipboard-apis/#remote-clipboard-sync). Maybe [Capability Delegation](https://github.com/WICG/capability-delegation) could be the answer here?!

Here's a [test page for `write()`](https://output.jsbin.com/yuliwoz/quiet) courtesy of Å ime, and here's a [test page for `writeText()`](https://fluoridated-showy-fog.glitch.me/) (based on Å ime's).

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/clipboard-apis/issues/182

You are receiving this because you are subscribed to this thread.

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

Received on Thursday, 11 August 2022 13:50:38 UTC