Commit 57b5a1e
committed
fix: add clipboard fallback for code block copy in web UI
The Clipboard API (navigator.clipboard.writeText) requires a
secure context (HTTPS or localhost). When the web UI is accessed
over plain HTTP or on platforms without clipboard support (e.g.,
Termux), the copy button silently fails.
Add a fallback using document.execCommand('copy') with a
temporary textarea element for non-secure contexts.
Fixes #13401 parent 7ba9695 commit 57b5a1e
1 file changed
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
511 | | - | |
| 511 | + | |
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
517 | | - | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
518 | 536 | | |
519 | 537 | | |
520 | 538 | | |
| |||
0 commit comments