Skip to content

Copy-to-clipboard crashes on insecure (HTTP) contexts #597

Description

@sudocarlos

What

Clicking any copy-to-clipboard action (code block, copyable attribute value, or the IP address menu on the Machines page) throws an uncaught TypeError: Cannot read properties of undefined (reading 'writeText') in the browser console and silently fails to copy anything.

Why

navigator.clipboard is only defined in secure contexts (HTTPS or localhost). Headplane is frequently self-hosted and accessed over plain HTTP (LAN, reverse proxy without TLS to the browser, etc.), so navigator.clipboard is undefined there, and calling .writeText(...) on it throws instead of failing gracefully or falling back to a legacy copy method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingUI/UXRelated to the frontend UI

    Projects

    Status
    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions