Commit 804c13b
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 94212ea commit 804c13b
1 file changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
| 396 | + | |
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
403 | 415 | | |
404 | 416 | | |
405 | 417 | | |
| |||
0 commit comments