mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6336] [Bug]: QR Code button downloads the QR image instead of copying the QR code content #4303
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#4303
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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
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
@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:CopyOutlined)QrPanel.tsx:104-106→copy()atQrPanel.tsx:69-72PictureOutlined).pngQrPanel.tsx:108-115→downloadImage()atQrPanel.tsx:91-95QrPanel.tsx:128-137→copyImage()atQrPanel.tsx:79-89The 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: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
catchabove saved the file instead. The usual cause of the second case is opening the panel over plainhttp://<ip>:<port>— Chromium/Edge only exposenavigator.clipboardin a secure context (HTTPS orlocalhost), 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 todocument.execCommand('copy')when the page is not a secure context, so it copies the link text even on a plain-HTTP panel:I could not open your screenshot, so if the button you pressed was the leftmost
CopyOutlinedone and it still produced a download, reply with that and the panel URL scheme (httporhttps) 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 todownloadImageBlob(blob, remark)whennavigator.clipboard.writethrows; copying the link text is the separatecopy()handler atQrPanel.tsx:69-72. Intent established by commite4218a10"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:112aria-label={t('downloadImage')}on the picture button;QrPanel.tsx:135onClick={copyImage}on the QR container;QrPanel.tsx:87downloadImageBlob(blob, remark);in thecatch;utils/index.ts:639if (navigator.clipboard && window.isSecureContext) {;internal/web/translation/en-US.json:14"copy": "Copy"and:20"downloadImage": "Download Image"; commite4218a10. 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
catchfallback 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 aCopytooltip (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.