Commit f476087
Fix Copy Page feature for mobile browsers
Implemented a cross-platform clipboard solution with fallback mechanism to resolve mobile browser compatibility issues.
Changes:
- Added copyToClipboard() helper function that tries modern Clipboard API first
- Falls back to document.execCommand('copy') for mobile browsers with user agent restrictions
- Updated handleCopyAsMarkdown() and handleCopyFromModal() to use new helper
- Fixes "user agent or platform" permission errors on iOS Safari and mobile Chrome
The fallback method uses an invisible textarea element positioned off-screen,
which is the standard approach for mobile clipboard compatibility.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 5e99d9c commit f476087
1 file changed
Lines changed: 38 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
35 | 71 | | |
36 | 72 | | |
37 | 73 | | |
| |||
53 | 89 | | |
54 | 90 | | |
55 | 91 | | |
56 | | - | |
| 92 | + | |
57 | 93 | | |
58 | 94 | | |
59 | 95 | | |
| |||
105 | 141 | | |
106 | 142 | | |
107 | 143 | | |
108 | | - | |
| 144 | + | |
109 | 145 | | |
110 | 146 | | |
111 | 147 | | |
| |||
0 commit comments