zai-org / zai-org/feedback

[Bug]ZCode 桌面端启动时越权接管 text/html 文件关联

Open
#656 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2 status: 待评估 type: Bug
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

提交前确认 · Pre-submission checklist
  • 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
  • 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category

UI / 界面体验 · UI / UX

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

影响体验 · Major (功能可用但体验受损 / works but degraded)

复现频率 · Reproducibility

必现 · Always

问题描述 · Description

【Linux 桌面端】启动时 deep-link 注册例程越权将 text/html 默认打开方式改写为 zcode.desktop,静默覆盖用户已设置的默认浏览器(Chrome),无任何用户交互,每次应用启动/初始化均会复发。

复现步骤 · Steps to reproduce
  1. 确认当前关联正常:xdg-mime query default text/html 输出 google-chrome.desktop
  2. 启动 ZCode 桌面端(触发其 deep-link 初始化例程)
  3. 再次查询:输出变为 zcode.desktop;~/.config/mimeapps.list 的 [Default Applications] 段被写入 text/html=zcode.desktop
期望表现 · Expected behavior

deep-link 注册只应写入 x-scheme-handler/zcode=zcode.desktop;不应触碰 text/html 或任何未在自身 .desktop 文件 MimeType 中声明的类型。/usr/share/applications/zcode.desktop 的声明仅为 MimeType=x-scheme-handler/zcode;,本不应出现在 html 默认程序路径上。

实际表现 · Actual behavior

应用启动 2 秒后 mimeapps.list 被改写,text/html 默认程序变为 zcode.desktop,用户双击 html 文件被 ZCode 接管;手动 xdg-mime 还原后下次启动再次被覆盖。

ZCode 版本 · ZCode version

3.11.2

设备 / 系统 / 浏览器 · Device / OS / Browser

x86_64 笔记本 / Ubuntu 20.04.6 LTS (GNOME, X11) / ZCode Linux 桌面端(Electron)

截图 / 录屏 / 日志 · Screenshots / Recordings / Logs

17:23:45 <主机名> org.freedesktop.FileManager1[8619]: [main] [crash-capture] configured remoteCrashReporterEnabled=true stagingDir=/.zcode/v2/crash/live
17:23:45 <主机名> org.freedesktop.FileManager1[8619]: [main] [deep-link] 注册协议成功 { scheme: 'zcode' }
17:23:45 <主机名> org.freedesktop.FileManager1[8619]: [main] [deep-link] Linux 系统级 desktop entry 已存在 { systemDesktopEntryPath: '/usr/share/applications/zcode.desktop' }
17:23:45 <主机名> org.freedesktop.FileManager1[8619]: [main] [deep-link] Linux 用户级协议注册成功 { desktopFilePath: '
/.local/share/applications/zcode.desktop', changed: false }
17:23:45 <主机名> org.freedesktop.FileManager1[8619]: [main] [arms] electron initialized env=prod version=3.11.2

17:23:47 ~/.config/mimeapps.list 修改时间为该时刻,[Default Applications] 新增 text/html=zcode.desktop

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Linux desktop deep-link registration routine described in the report and reproduce it with xdg-mime and ~/.config/mimeapps.list on Ubuntu. Verify that initialization registers only x-scheme-handler/zcode and leaves text/html unchanged; done when repeated launches no longer overwrite the user's browser association.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.