inspector icon indicating copy to clipboard operation
inspector copied to clipboard

fix(client): fall back when config clipboard copy is blocked

Open go165 opened this issue 5 months ago • 0 comments

Fixes #913.

The Sidebar copy buttons now fall back to a temporary textarea + execCommand copy when navigator.clipboard.writeText is unavailable or rejected. That avoids the browser warning/popup path seen in self-hosted or permission-restricted Inspector setups while keeping the copied JSON unchanged.

Validation:

  • client/src/components/tests/Sidebar.test.tsx
  • npm run lint (client)
  • npx prettier --check client/src/components/Sidebar.tsx client/src/components/tests/Sidebar.test.tsx
  • npm install (repo build ran via prepare)

The fallback is only used when Clipboard API copy fails; normal clipboard writes still use navigator.clipboard.writeText.

go165 avatar Jun 14 '26 01:06 go165