different-ai/openwork · warning

Clipboard is not available in this browser.

Error message

Clipboard is not available in this browser.

What it means

workspace-claim-screen.tsx throws this before attempting the handoff request when `navigator.clipboard` is undefined. The Clipboard API is only available in secure contexts (HTTPS or localhost) and in some browsers requires focus/permission.

Source

Thrown at ee/apps/den-web/app/(den)/_components/workspace-claim-screen.tsx:243

    setHandoffAttempted(true);

    try {
      window.location.assign(await createDesktopHandoff());
    } catch (error) {
      setHandoffError(error instanceof Error ? error.message : "Could not open OpenWork.");
    } finally {
      setHandoffBusy(false);
    }
  }

  async function handleCopyOpenWorkLink() {
    setCopyBusy(true);
    setLinkCopied(false);
    setHandoffError(null);

    try {
      if (!navigator.clipboard) {
        throw new Error("Clipboard is not available in this browser.");
      }

      const openworkUrl = await createDesktopHandoff();
      await navigator.clipboard.writeText(openworkUrl);
      setLinkCopied(true);
      window.setTimeout(() => setLinkCopied(false), 1800);
    } catch (error) {
      setHandoffError(error instanceof Error ? error.message : "Could not copy the OpenWork link.");
    } finally {
      setCopyBusy(false);
    }
  }

  function continueInBrowser() {
    router.replace(getOrgDashboardRoute(claimedOrg?.organizationSlug ?? null));
  }

  if (!token) {

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Serve the app over HTTPS (or localhost) so the Clipboard API is exposed
  2. Add a clipboard-write permission policy if embedded in an iframe (`allow="clipboard-write"`)
  3. Fall back to `document.execCommand("copy")` with a hidden textarea for non-secure contexts
  4. Show the link as selectable text so the user can copy it manually

Example fix

// before
if (!navigator.clipboard) {
  throw new Error("Clipboard is not available in this browser.");
}
// after
if (!navigator.clipboard) {
  await legacyCopyText(openworkUrl);
  return;
}
Defensive patterns

Strategy: fallback

Validate before calling

if (!window.isSecureContext || !navigator.clipboard) {
  showFallbackCopyUI(linkText); // manual-select + execCommand path
  return;
}

Type guard

function clipboardAvailable(nav: Navigator): nav is Navigator & { clipboard: Clipboard } {
  return typeof nav.clipboard !== "undefined";
}

Try / catch

try {
  await navigator.clipboard.writeText(url);
} catch (err) {
  legacyCopyViaExecCommand(url) || promptToCopyManually(url);
}

Prevention

When it happens

Trigger: User clicks 'Copy OpenWork link' while the page is served over plain HTTP, inside a non-secure iframe, or in a browser/webview that does not expose navigator.clipboard (older browsers, some in-app webviews).

Common situations: Den web accessed via http:// on a LAN IP; embedded in an iframe without clipboard permission policy; iOS in-app browser or old Chrome/Firefox versions lacking the async Clipboard API.

Related errors


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/d4ba91797a8d5ccb. Report an issue: GitHub.