[GH-ISSUE #6336] [Bug]: QR Code button downloads the QR image instead of copying the QR code content #4303

Closed
opened 2026-10-31 20:38:41 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @KanekiDevPro on GitHub (Aug 26, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6336

Describe the bug

When clicking the QR Code button for a client configuration, the QR code is downloaded as an image instead of being copied to the clipboard.

This makes the copy action behave differently from what is expected from the QR Code button.

How to reproduce the problem

  1. Log in to the 3x-ui panel.
  2. Open an inbound containing a client.
  3. Open the client's QR Code.
  4. Click the QR Code/copy button.
  5. The QR code image is downloaded instead of the QR code content being copied to the clipboard.

Expected behavior

Clicking the QR Code copy button should copy the QR code content/configuration to the clipboard instead of downloading the QR code image.

Actual behavior

Clicking the button downloads the QR code as an image file, and the QR code content is not copied to the clipboard.

Relevant logs

No relevant panel or Xray logs are generated. This appears to be a frontend/UI issue.

3x-ui version

v3.7.0

Xray-core version

v26.7.28

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04 LTS

Which parts of the panel are affected?

Subscription (share links / Clash / JSON)

Browser (only if it is a UI bug)

Microsoft Edge

Is the panel behind a reverse proxy or CDN?

None

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @KanekiDevPro on GitHub (Aug 26, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6336 ### Describe the bug When clicking the QR Code button for a client configuration, the QR code is downloaded as an image instead of being copied to the clipboard. This makes the copy action behave differently from what is expected from the QR Code button. ### How to reproduce the problem 1. Log in to the 3x-ui panel. 2. Open an inbound containing a client. 3. Open the client's QR Code. 4. Click the QR Code/copy button. 5. The QR code image is downloaded instead of the QR code content being copied to the clipboard. ### Expected behavior Clicking the QR Code copy button should copy the QR code content/configuration to the clipboard instead of downloading the QR code image. ### Actual behavior Clicking the button downloads the QR code as an image file, and the QR code content is not copied to the clipboard. ### Relevant logs ```shell No relevant panel or Xray logs are generated. This appears to be a frontend/UI issue. ``` ### 3x-ui version v3.7.0 ### Xray-core version v26.7.28 ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 LTS ### Which parts of the panel are affected? Subscription (share links / Clash / JSON) ### Browser (only if it is a UI bug) Microsoft Edge ### Is the panel behind a reverse proxy or CDN? None ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:38:41 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@github-actions[bot] commented on GitHub (Aug 26, 2026):

Clicking the QR image itself is meant to copy/save the QR picture, not the link text — the control that copies the config text is the small Copy button in the panel header, next to the green remark tag. So what you are seeing is the intended design, not a regression.

The QR panel (frontend/src/pages/inbounds/qr/QrPanel.tsx) has three separate controls:

control what it does code
Copy (CopyOutlined) copies the link / config text to the clipboard QrPanel.tsx:104-106 → copy() at QrPanel.tsx:69-72
Download Image (PictureOutlined) saves the QR as a .png QrPanel.tsx:108-115 → downloadImage() at QrPanel.tsx:91-95
the QR square itself copies the QR image to the clipboard, and downloads the PNG if that fails QrPanel.tsx:128-137 → copyImage() at QrPanel.tsx:79-89

The behaviour was changed deliberately in commit e4218a10 — "feat: click QR to copy/save image instead of link text" — which replaced the old @click="copy" on the QR with @click="copyImage". The download is the explicit fallback branch inside that function:

// frontend/src/pages/inbounds/qr/QrPanel.tsx:83-88
    try {
      await navigator.clipboard.write([new ClipboardItem({ 'image/png': blob })]);
      messageApi.success(t('copied'));
    } catch {
      downloadImageBlob(blob, remark);
    }

Why you got a download rather than a clipboard copy: either you pressed the Download Image button, or the image-clipboard write threw and the catch above saved the file instead. The usual cause of the second case is opening the panel over plain http://<ip>:<port> — Chromium/Edge only expose navigator.clipboard in a secure context (HTTPS or localhost), so line 84 throws and the PNG is downloaded. That part is browser behaviour, so it is an inference, not something I can cite from this repository.

What to use instead: press the Copy button (the first small button, left of the picture and download buttons). It goes through ClipboardManager.copyText, which falls back to document.execCommand('copy') when the page is not a secure context, so it copies the link text even on a plain-HTTP panel:

// frontend/src/utils/index.ts:637-645
  static async copyText(content: unknown = ''): Promise<boolean> {
    const text = String(content ?? '');
    if (navigator.clipboard && window.isSecureContext) {
      try {
        await navigator.clipboard.writeText(text);
        return true;
      } catch {}
    }
    return ClipboardManager._legacyCopy(text);

I could not open your screenshot, so if the button you pressed was the leftmost CopyOutlined one and it still produced a download, reply with that and the panel URL scheme (http or https) and this can be reopened.

Verdict: Not a bug (expected behaviour)
Severity: N/A
Confidence: High that clicking the QR is designed to copy/save the image; Medium on the insecure-context explanation for the download you saw (browser behaviour, not repo source)
Root cause: No defect. copyImage() (frontend/src/pages/inbounds/qr/QrPanel.tsx:79-89) intentionally copies the rendered QR as PNG and falls back to downloadImageBlob(blob, remark) when navigator.clipboard.write throws; copying the link text is the separate copy() handler at QrPanel.tsx:69-72. Intent established by commit e4218a10 "feat: click QR to copy/save image instead of link text".
Already fixed: Not applicable — behaviour is unchanged and intentional on the default branch (f727d04f, v3.7.0)
Duplicate of: Related: #4774 — same copyImage() handler, other symptom ("nothing happened", i.e. an image landed on the clipboard instead of the link)
Evidence: QrPanel.tsx:105 <Button size="small" icon={<CopyOutlined />} aria-label={t('copy')} onClick={copy} />; QrPanel.tsx:112 aria-label={t('downloadImage')} on the picture button; QrPanel.tsx:135 onClick={copyImage} on the QR container; QrPanel.tsx:87 downloadImageBlob(blob, remark); in the catch; utils/index.ts:639 if (navigator.clipboard && window.isSecureContext) {; internal/web/translation/en-US.json:14 "copy": "Copy" and :20 "downloadImage": "Download Image"; commit e4218a10. No test pins the QR click handler either way.
Not determined: Which of the three controls was pressed — the screenshot is not readable here. Whether the panel is served over HTTPS would settle whether the download came from the catch fallback or from the Download Image button.

One thing worth a maintainer's eye, not a defect: the QR container carries aria-label={t('copy')} and a Copy tooltip (QrPanel.tsx:134, :138) while the fallback silently downloads a file, which is what makes this read as a bug to users on non-HTTPS panels.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:5430985332 --> @github-actions[bot] commented on GitHub (Aug 26, 2026): Clicking the QR image itself is **meant** to copy/save the QR **picture**, not the link text — the control that copies the config text is the small **Copy** button in the panel header, next to the green remark tag. So what you are seeing is the intended design, not a regression. The QR panel (`frontend/src/pages/inbounds/qr/QrPanel.tsx`) has three separate controls: | control | what it does | code | | --- | --- | --- | | **Copy** (`CopyOutlined`) | copies the link / config **text** to the clipboard | `QrPanel.tsx:104-106` → `copy()` at `QrPanel.tsx:69-72` | | **Download Image** (`PictureOutlined`) | saves the QR as a `.png` | `QrPanel.tsx:108-115` → `downloadImage()` at `QrPanel.tsx:91-95` | | the QR square itself | copies the QR **image** to the clipboard, and **downloads the PNG if that fails** | `QrPanel.tsx:128-137` → `copyImage()` at `QrPanel.tsx:79-89` | The behaviour was changed deliberately in commit `e4218a10` — *"feat: click QR to copy/save image instead of link text"* — which replaced the old `@click="copy"` on the QR with `@click="copyImage"`. The download is the explicit fallback branch inside that function: ```ts // frontend/src/pages/inbounds/qr/QrPanel.tsx:83-88 try { await navigator.clipboard.write([new ClipboardItem({ 'image/png': blob })]); messageApi.success(t('copied')); } catch { downloadImageBlob(blob, remark); } ``` Why you got a download rather than a clipboard copy: either you pressed the **Download Image** button, or the image-clipboard write threw and the `catch` above saved the file instead. The usual cause of the second case is opening the panel over plain `http://<ip>:<port>` — Chromium/Edge only expose `navigator.clipboard` in a secure context (HTTPS or `localhost`), so line 84 throws and the PNG is downloaded. That part is browser behaviour, so it is an inference, not something I can cite from this repository. **What to use instead:** press the **Copy** button (the first small button, left of the picture and download buttons). It goes through `ClipboardManager.copyText`, which falls back to `document.execCommand('copy')` when the page is not a secure context, so it copies the link text even on a plain-HTTP panel: ```ts // frontend/src/utils/index.ts:637-645 static async copyText(content: unknown = ''): Promise<boolean> { const text = String(content ?? ''); if (navigator.clipboard && window.isSecureContext) { try { await navigator.clipboard.writeText(text); return true; } catch {} } return ClipboardManager._legacyCopy(text); ``` I could not open your screenshot, so if the button you pressed was the leftmost `CopyOutlined` one and it still produced a download, reply with that and the panel URL scheme (`http` or `https`) and this can be reopened. Verdict: Not a bug (expected behaviour) Severity: N/A Confidence: High that clicking the QR is designed to copy/save the image; Medium on the insecure-context explanation for the download you saw (browser behaviour, not repo source) Root cause: No defect. `copyImage()` (`frontend/src/pages/inbounds/qr/QrPanel.tsx:79-89`) intentionally copies the rendered QR as PNG and falls back to `downloadImageBlob(blob, remark)` when `navigator.clipboard.write` throws; copying the link *text* is the separate `copy()` handler at `QrPanel.tsx:69-72`. Intent established by commit `e4218a10` "feat: click QR to copy/save image instead of link text". Already fixed: Not applicable — behaviour is unchanged and intentional on the default branch (`f727d04f`, v3.7.0) Duplicate of: Related: #4774 — same `copyImage()` handler, other symptom ("nothing happened", i.e. an image landed on the clipboard instead of the link) Evidence: `QrPanel.tsx:105` `<Button size="small" icon={<CopyOutlined />} aria-label={t('copy')} onClick={copy} />`; `QrPanel.tsx:112` `aria-label={t('downloadImage')}` on the picture button; `QrPanel.tsx:135` `onClick={copyImage}` on the QR container; `QrPanel.tsx:87` `downloadImageBlob(blob, remark);` in the `catch`; `utils/index.ts:639` `if (navigator.clipboard && window.isSecureContext) {`; `internal/web/translation/en-US.json:14` `"copy": "Copy"` and `:20` `"downloadImage": "Download Image"`; commit `e4218a10`. No test pins the QR click handler either way. Not determined: Which of the three controls was pressed — the screenshot is not readable here. Whether the panel is served over HTTPS would settle whether the download came from the `catch` fallback or from the Download Image button. One thing worth a maintainer's eye, not a defect: the QR container carries `aria-label={t('copy')}` and a `Copy` tooltip (`QrPanel.tsx:134`, `:138`) while the fallback silently downloads a file, which is what makes this read as a bug to users on non-HTTPS panels. *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#4303
No description provided.