Commit 1e145d6
committed
fix: make 'Copy Magnet' button work in non-secure (HTTP) contexts.
navigator.clipboard is only defined in secure contexts, so the button
silently failed when the UI was served over plain HTTP. Feature-detect
the modern API and fall back to a hidden textarea + execCommand('copy'),
which works everywhere.1 parent 33e0cb6 commit 1e145d6
2 files changed
Lines changed: 31 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
13 | 42 | | |
14 | 43 | | |
15 | 44 | | |
| |||
1439 | 1468 | | |
1440 | 1469 | | |
1441 | 1470 | | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
| 1471 | + | |
1445 | 1472 | | |
1446 | 1473 | | |
1447 | 1474 | | |
| |||
0 commit comments