- From: Gary Kacmarcik <notifications@github.com>
- Date: Wed, 14 Feb 2018 11:51:56 -0800
- To: w3c/clipboard-apis <clipboard-apis@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 14 February 2018 19:52:19 UTC
The Async API doesn't require a gesture in Chrome. If you had the promise fail in the dev console, it's most likely because the dev console is not considered to be part of the foreground tab. When testing, I use the following snippet: ``` write = function() {navigator.clipboard.writeText("sample text").then(function(){console.log("copied to clipboard");}, function() {console.log("not copied to clipboard");});} setTimeout(write, 5000) ``` and then I switch to the main tab during the 5 sec timer. These failures (missing gesture, not active tab) will likely vary for different UAs, but it seems like we could define a set of standard failures that the UAs could return: * Permission not granted * User gesture not present * Tab not the currently active tab -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/clipboard-apis/issues/66#issuecomment-365724979
Received on Wednesday, 14 February 2018 19:52:19 UTC