SimpelMe / 7-seconds-to-die

With this tool you can transfer text from one device to another.
https://simpel.cc/7-seconds-to-die
MIT License
0 stars 0 forks source link

navigator.clipboard.writeText() not working with iOS #1

Open SimpelMe opened 3 years ago

SimpelMe commented 3 years ago

In iOS (and probably other os to) navigator.clipboard.writeText() isn't working the way I intend. In iOS it needs to be called by an user activated event like pointerup. I didn't get an pointerup event to work with navigator.clipboard.writeText() and the http request before to get the pastebin.

Maybe someone can fix this issue.

https://github.com/SimpelMe/7-seconds-to-die/blob/52ff38009a8953af0b3a82473a8d28d6c3452cd4/functions.js#L139

SimpelMe commented 2 years ago

Problem is that safari (OSX too) needs clipboard.writeText unnested. As you have to wait for downloading the file clipboard.writeText had to be nested. I found a work around with a third button only putting already downloaded content to clipboard. Other browsers then safari can trigger this third button with javascript after file is downloaded. This third button is needed visible only for safari. See: 8824810