Drop browser-process gate to support Edge and any Chromium browser (Closes #55) - #66
Open
gkd2323c wants to merge 2 commits into
Open
Drop browser-process gate to support Edge and any Chromium browser (Closes #55)#66gkd2323c wants to merge 2 commits into
gkd2323c wants to merge 2 commits into
Conversation
不再通过 is_chrome_running() 检测 chrome.exe / msedge.exe 进程名, connect_daemon_page 直接进入 daemon 握手;浏览器是否可用由 daemon 与扩展 的真实连接状态决定,而非臆测的进程名。 对比 Issue nashsu#55 提议的"加 msedge 白名单"方案,本改动更彻底: - 通用:任何装了扩展的 Chromium 浏览器(Chrome/Edge/Brave/Arc 等)直接可用 - 诚实:扩展未连时报 'Chrome extension not connected' 而非伪装成 'Chrome is not running' - 零维护:无需随浏览器种类增长维护进程名清单 只改动 crates/autocli-browser/src/bridge.rs,删除 is_chrome_running 及其调用门卫。
wake_chrome() 在扩展 5s 未连上时触发,原实现硬编码拉起 Chrome (macOS: open -a "Google Chrome";Windows: start chrome),会在未装/不 用 Chrome 的机器上误拉起 Chrome。 改为开系统默认浏览器: - Windows: cmd /C start "" about:blank(空标题参数使 about:blank 被当 URL) - macOS/Linux: open / xdg-open about:blank 这样 Edge/Brave/Arc 等任意默认 Chromium 浏览器都能被唤醒,且不绑定 具体浏览器二进制。与"移除 is_chrome_running 门卫"同一思路(PR nashsu#66)。
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.
Background
Issue #55 reports that browser-mode commands (bilibili / zhihu / twitter / etc.) refuse to work on Microsoft Edge, because
is_chrome_running()only checks forchrome.exeand never recognizesmsedge.exe.autocli doctorshows the extension is connected, yet commands still fail with "Chrome is not running". A second, related bug: even after the gate is gone,wake_chrome()hardcodes launching Google Chrome, so on a machine without/avoiding Chrome the daemon would still spawn Chrome when the extension needs waking.Changes in this PR
1. Remove the browser-process detection gate
is_chrome_running()and its call site inconnect_daemon_page2. Make
wake_chrome()open the default browser, not Chromecmd /C start "" about:blank(empty title arg soabout:blankis treated as a URL, not a program name)open/xdg-open about:blankWhy this beats the allowlist approach
The original issue proposed adding
msedge.exe(and macOS/Linux equivalents) insideis_chrome_running(). Removing the gate is more fundamental:Chrome extension not connectedinstead of masquerading asChrome is not runningVerification
cargo build --releasepassesautocli doctorshowsChrome extension connectedwith only Edge running (no Chrome)autocli zhihu hotfetch data end-to-endchrome.exeprocess is spawned; the default browser (Edge) is used insteadOnly
crates/autocli-browser/src/bridge.rsis changed (two commits: gate removal + wake fix).Closes #55