MystBin icon indicating copy to clipboard operation
MystBin copied to clipboard

Save button doesn't work in Safari

Open numbermaniac opened this issue 3 years ago • 2 comments

When you press the save button in Safari it just shows the spinning wheel forever and never saves it.

Screen recording from a user in discord.py's general channel:

https://cdn.discordapp.com/attachments/336642776609456130/1062602270233079889/Screen_Recording_2023-01-10_at_10.21.30_PM.mov

Was able to reproduce it myself using Safari 16.2 on macOS 12.6. This is the JavaScript error that appears: Screen Shot 2023-01-11 at 6 07 20 pm

numbermaniac avatar Jan 11 '23 07:01 numbermaniac

To shed a bit more light on this issue, Safari's implementation of the asynchronous clipboard API back in 13.1 requires that clipboard manipulation - that is, reading or writing - be initiated from a "user event" to protect user privacy. According to WHATWG's standard, these user events are keydown, mousedown, pointerdown, pointerup, and touchend.

While the "Save Paste" button's callback is indeed initiated by the user via clicking the button (mousedown/pointerdown/touchend) or pressing Ctrl-S (keydown), the consent doesn't seem to carry over to the callback, and so the browser complains. I made a (very brief) proof-of-concept in this CodePen to further explain.

m-sterling avatar Jun 10 '23 05:06 m-sterling

Thanks, we know what the issue is already and it will be fixed once the site has been redesigned.

chillymosh avatar Jun 10 '23 07:06 chillymosh

I believe this has been corrected in our latest build & release and is live at https://mystb.in

If this is not the case please feel free to re-open this and we can look into it once again.

AbstractUmbra avatar May 10 '24 20:05 AbstractUmbra