Repository navigation
feat(browser): tell browsers apart, and let the user choose one - #1072
Merged
leookun merged 3 commits intoNov 17, 2026
Merged
Conversation
|
Thanks for the pull request! It doesn't follow CONTRIBUTING.md yet:
感谢提交!这个 PR 还不符合 CONTRIBUTING.md:
|
added 2 commits
November 17, 2026 12:50
The native host says the executable of the browser it runs in, walking past the cmd.exe Windows starts it with; the extension says its Chromium version beside the brand (Cent Browser's UA says Google Chrome, its version does not). A browser left running with no window now answers tabs.list with none shared instead of failing every call with "No current window", and tabs.create opens a window for it.
Settings → Browser now says each connected browser's own name (Cent Browser is not Google Chrome), its engine and version, and the path of its executable, so two alike-branded browsers can be told apart. Each row has "Use This Browser": the choice is kept as settings.json's browser.preferred, and the agents' tools use that browser while it is connected (the last connected when none is chosen). A chosen browser that is not connected is said as such, not switched away from. The file-access note says which browser it is about.
hatricks-s
force-pushed
the
feat/browser-choice-and-identity
branch
from
November 17, 2026 04:50
8751392 to
a4250be
Compare
- With the browser chosen in Settings → Browser not connected, the tools use the last connected rather than failing; the settings say which, until it connects again. - The history finds a request's live tab in the browser the tools use. - dart format; the analyzer's null-aware elements. Co-Authored-By: BaoCode <noreply@baocode.dev>
Contributor
Author
|
Thanks for the fix — the fallback reads better than the error. I kept it as is and trimmed the names and three comments to get the gate's count from 406 to 398. Ran Flutter 3.47.5 (the Checks version) locally on Windows: |
leolee-code
pushed a commit
to leolee-code/baocode
that referenced
this pull request
Nov 17, 2026
…ode-dev#1072) * feat(browser): Say which browser and engine each one is The native host says the executable of the browser it runs in, walking past the cmd.exe Windows starts it with; the extension says its Chromium version beside the brand (Cent Browser's UA says Google Chrome, its version does not). A browser left running with no window now answers tabs.list with none shared instead of failing every call with "No current window", and tabs.create opens a window for it. * feat(browser): Name browsers truly, and let the user choose one Settings → Browser now says each connected browser's own name (Cent Browser is not Google Chrome), its engine and version, and the path of its executable, so two alike-branded browsers can be told apart. Each row has "Use This Browser": the choice is kept as settings.json's browser.preferred, and the agents' tools use that browser while it is connected (the last connected when none is chosen). A chosen browser that is not connected is said as such, not switched away from. The file-access note says which browser it is about. * fix(browser): a chosen browser away, the last connected is used - With the browser chosen in Settings → Browser not connected, the tools use the last connected rather than failing; the settings say which, until it connects again. - The history finds a request's live tab in the browser the tools use. - dart format; the analyzer's null-aware elements. --------- Co-authored-by: yanyh <yanyh@glodon.com> Co-authored-by: leo <leokuncn@gmail.com> (cherry picked from commit 3d74618)
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.
Issue: #1071
Settings → Browser could not tell two Chromium browsers apart (Cent Browser reports the brand
Google Chrome), did not say which browser the file-access note was about, and gave no way to pick the browser the agents use. With several browsers connected the tools always used the last connected — and when that was a browser left running with no window, every call failed with Chrome'sNo current window.What changed
macos/BrowserBridge/host.c, used on Linux too, andwindows/BrowserBridge/host.cpp) reports its browser's executable: the process that started it, walking past thecmd.exeWindows starts it with. The extension reports the Chromium version from UA-CH'sfullVersionList, falling back to the user agent.displayNametakes the name from the executable where the brand is borrowed (centbrowser→ Cent Browser,microsoft edge→ Microsoft Edge, …), the brand otherwise.Chromium <version>, the executable's path and the extension's version. Each row has Use This Browser; the choice is kept assettings.json'sbrowser.preferred(the executable's path). The tools use that browser while it is connected; when it is not, they use the last connected and the settings say which, until it connects again.groups()catchesNo current window:tabs.listanswers with no shared tabs andtabs.createopens a window. The file-access note names its browser now.The extension's version is 0.2.1.
How it was tested
With Flutter 3.47.5 (the
FLUTTER_VERSIONin Checks) on Windows:flutter analyze --fatal-infos: no issues.dart format --output=none --set-exit-if-changedon the changed Dart files: clean.flutter test test/browser/browser_bridge_test.dart test/browser/browser_welcome_test.dart test/settings/browser_page_test.dart test/l10n_test.dart: 29 passed, 6 skipped (the socket tests skip on Windows). The new test also passes on Windows with itsskipremoved for the run.windows/BrowserBridge/host.cpp: compiles withg++ -std=c++17 -Wall -Wextra -Werror(MinGW),_WIN32_WINNT=0x0600.Checklist
accepted.dart format,flutter analyzeand the related tests pass.