Bug
_open_chrome_inspect() in admin.py uses webbrowser.open(url, new=2) on Windows to open chrome://inspect/#remote-debugging. Windows does not support the chrome:// protocol via webbrowser.open() — it triggers a "Get an app to open this" Microsoft Store dialog instead of opening the URL in Chrome.
macOS correctly uses AppleScript to tell Chrome to open the URL, but Windows has no equivalent handling.
Steps to reproduce
- On Windows, run
browser-harness --setup when Chrome is running but remote debugging is not enabled on the current profile
- The setup flow calls
_open_chrome_inspect() to open chrome://inspect/#remote-debugging
- Windows shows "Get an app to open this chrome link" dialog instead of opening the page in Chrome
Expected behavior
chrome://inspect/#remote-debugging should open in the running Chrome instance.
Fix
Add Windows-specific handling that directly invokes the Chrome executable with the URL as an argument, similar to the macOS AppleScript approach:
elif platform.system() == "Windows":
for candidate in (
Path(os.environ.get("PROGRAMFILES", "")) / "Google/Chrome/Application/chrome.exe",
Path(os.environ.get("PROGRAMFILES(X86)", "")) / "Google/Chrome/Application/chrome.exe",
Path(os.environ.get("LOCALAPPDATA", "")) / "Google/Chrome/Application/chrome.exe",
):
if candidate.exists():
try:
subprocess.Popen([str(candidate), url])
return
except Exception:
pass
Environment
- OS: Windows 11
- Chrome: latest
- browser-harness: 0.1.0 (git)
Bug
_open_chrome_inspect()inadmin.pyuseswebbrowser.open(url, new=2)on Windows to openchrome://inspect/#remote-debugging. Windows does not support thechrome://protocol viawebbrowser.open()— it triggers a "Get an app to open this" Microsoft Store dialog instead of opening the URL in Chrome.macOS correctly uses AppleScript to tell Chrome to open the URL, but Windows has no equivalent handling.
Steps to reproduce
browser-harness --setupwhen Chrome is running but remote debugging is not enabled on the current profile_open_chrome_inspect()to openchrome://inspect/#remote-debuggingExpected behavior
chrome://inspect/#remote-debuggingshould open in the running Chrome instance.Fix
Add Windows-specific handling that directly invokes the Chrome executable with the URL as an argument, similar to the macOS AppleScript approach:
Environment