Skip to content

ErrorBoundary clipboard write has no permission check or fallback #153

Open

Description

@mia-lee-hk

ErrorBoundary clipboard write has no permission check or fallback

Severity: Low
File: frontend/src/components/ErrorBoundary.tsx:87

The "Copy Diagnostics" button calls navigator.clipboard.writeText() without checking if the Clipboard API is available or if the user has granted permission. In restricted contexts (iframes, older browsers), this throws an error.

navigator.clipboard.writeText(JSON.stringify(diagnostics, null, 2))
this.setState({ copied: true })
setTimeout(() => this.setState({ copied: false }), 2000)

Why it matters

When the clipboard API is unavailable, the copy button fails silently or throws, leaving users unable to share error diagnostics with support. A fallback using document.execCommand('copy') or a textarea would be more robust.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions