Skip to content

feat: support WSL2 environment in find-url#126

Open
xiuerhuahuazi wants to merge 1 commit into
eze-is:mainfrom
xiuerhuahuazi:feat/wsl2-browser-dirs
Open

feat: support WSL2 environment in find-url#126
xiuerhuahuazi wants to merge 1 commit into
eze-is:mainfrom
xiuerhuahuazi:feat/wsl2-browser-dirs

Conversation

@xiuerhuahuazi
Copy link
Copy Markdown

What

find-url.mjs 在 WSL2 下能自动发现 Windows 侧的 Chrome/Edge 数据目录。

Why

WSL2 用户的浏览器运行在 Windows 端,数据在 /mnt/c/Users/<user>/AppData/Local/,原脚本只查 ~/.config/
导致完全找不到书签和历史。

How

knownBrowserDataDirs() 开头加 WSL2 检测(/mnt/c/Users 存在性),扫描该路径下的 Chrome/Edge 数据目录,找到则直接返回,否则回退到标准 Linux 路径。

  • 跳过系统用户(.xxxAll UsersDefault 等)
  • 标签带用户名:Chrome (xiuerhuahuazi) / Edge (xiuerhuahuazi)
  • 权限不足等异常静默跳过,不影响后续逻辑

Scope

仅改 scripts/find-url.mjsknownBrowserDataDirs 函数,其他逻辑不变。

bb687b655943856fe78e2640198c62bc 微信图片_2026-06-02_162619_460

WSL2 用户的浏览器运行在 Windows 端,数据在
/mnt/c/Users/<user>/AppData/Local/,原脚本只查 ~/.config/ 导致完全找不到。

在 knownBrowserDataDirs() 开头加 WSL2 检测,扫描 Windows 侧浏览器数据,
找到则直接返回,否则回退到标准 Linux 路径。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant