lus / pasty

pasty is a fast and lightweight code pasting server
https://pasty.lus.pm
MIT License
200 stars 27 forks source link

Access to clipboard #35

Closed Fastidious closed 2 years ago

Fastidious commented 2 years ago

I am getting "Clipboard permission denied" when clicking on the clipboard icon. Happening on macOS 12.1, under Safari 15.2 (17612.3.6.1.6).

lus commented 2 years ago

I hate browsers. I'll fix it later this evening.

Fastidious commented 2 years ago

I forgot to specify that I am running from the develop branch. Apologies about the omission.

lus commented 2 years ago

No worries, the corresponding code should be equal on both branches anyway. Thank you for reporting!

lus commented 2 years ago

I could reproduce the error on my iPad and found out that it occurs because Safari does not support the Permissions API which was used to ask for clipboard-write permissions. This permission check however is redundant as the clipboard-write permission automatically is granted for active tabs, so I completely removed it. Another check using my iPad succeeded. I will redeploy the public instance in the next few minutes, please let me know if the issue is fixed for you. Remember that you may need to hard-refresh the tab where you opened pasty in order to refresh your browser cache.

Fastidious commented 2 years ago

Worked perfectly. Thanks for the quick fix!