feat: support WSL2 environment in find-url#126
Open
xiuerhuahuazi wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 路径。.xxx、All Users、Default等)Chrome (xiuerhuahuazi)/Edge (xiuerhuahuazi)Scope
仅改
scripts/find-url.mjs的knownBrowserDataDirs函数,其他逻辑不变。