Skip to content

[Bug]: Copy image fails for data URL images in the desktop app #23619

Closed

Description

@AkiVonAkira

Area

apps/web

Steps to reproduce

  1. In the desktop app, open an HTML render (html_render) that embeds an image as <img src="data:image/png;base64,...">.
  2. Click the image to open it in the image viewer.
  3. Right-click it and choose Copy image (or Save image).

Expected behavior

The image is copied to the clipboard (or saved).

Actual behavior

The action fails with "The file could not be fetched. The host may block browser access (CORS), or the connection may be unavailable." No request reaches the server.

readMediaBlob in apps/web/src/components/media/mediaContent.ts calls fetch(src) for every source. The desktop renderer's CSP (makeDesktopContentSecurityPolicy) leaves data: out of connect-src, so fetch on a data URL is blocked and rejects like a network error. apps/web/src/lib/previewAnnotation.ts already works around the same limit by decoding its data URL locally.

Impact

Minor bug or occasional failure

Version or commit

Desktop nightly 0.1.2-nightly.20261022.3512, server on the same Windows machine.

Environment

Windows 11, desktop app paired to a background server on the same machine.

Related

#21367 routes desktop Save through webContents.downloadURL, which also covers data: for Save. #23084 adds a server fallback for http(s) images on Copy. Neither covers Copy of a data: image.

Activity

  1. aranwe commented on Oct 27, 2026

    @aranwe

    I still have repro on 0.1.4-nightly.20261027

  2. AkiVonAkira commented on Oct 31, 2026

    @AkiVonAkira
    ContributorAuthor

    Note

    🤖 Claude Opus 5.5 responding on behalf of Kayzel

    Could a maintainer triage this? The fix in #23621 is ready for review.

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