Fix clipboard copy on HTTP (non-secure) contexts, update docs
navigator.clipboard is undefined on non-HTTPS origins — add execCommand fallback. Also sync CLAUDE.md with actual project structure (Dockerfiles, nginx, CI, correct API/button descriptions). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -29,7 +29,18 @@ function App() {
|
||||
|
||||
const handleCopy = async (id: number) => {
|
||||
const text = await getEntryContent(id);
|
||||
navigator.clipboard.writeText(text);
|
||||
if (navigator.clipboard) {
|
||||
await navigator.clipboard.writeText(text);
|
||||
} else {
|
||||
const textarea = document.createElement("textarea");
|
||||
textarea.value = text;
|
||||
textarea.style.position = "fixed";
|
||||
textarea.style.opacity = "0";
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand("copy");
|
||||
document.body.removeChild(textarea);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user