Commit a9a933e
Fix copy page button not working in Safari (#5560)
* Fix copy page button not working in Safari
Safari requires clipboard writes to begin in the synchronous call stack
of a user gesture. The previous code awaited fetch() before calling
navigator.clipboard.writeText(), breaking the gesture chain. Use
ClipboardItem with a Promise<Blob> so the clipboard write starts
synchronously while content resolves asynchronously.
https://claude.ai/code/session_018e1sgeEGsu8UsSYkq6tkfb
* Simplify clipboard write to use ClipboardItem unconditionally
Remove the ClipboardItem.supports check and writeText fallback. All
modern browsers support ClipboardItem with Promise<Blob>, and the
supports() method may not exist in older Safari versions that still
need the synchronous gesture fix.
https://claude.ai/code/session_018e1sgeEGsu8UsSYkq6tkfb
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent e6e63b0 commit a9a933e
1 file changed
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
33 | 44 | | |
34 | 45 | | |
35 | 46 | | |
| |||
0 commit comments