-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Problem/Bug]: CDP server connection - different applications visible through localhost and loopback #4709
Comments
This seems to be due to forcing all WebView2 apps to create WebView2 with I assume that you have followed the instruction and created a registry value named The documentation needs some update. I'll create an internal work item to track that. |
✅ Successfully linked to Azure Boards work item(s): |
Docs updated to specify app exe: Thanks! |
Wow hey guys, thank you so much for responding so promptly! Seems to be doing the trick, when I replaced the asterisk with Huge thank you for updating the documentation, love it. Just a suggestion: you could add a reference to the page which describes the environment variables associated with CDP debugger (that's the one you linked @LiangTheDev: https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.2592.51#createcorewebview2environmentwithoptions). Also, a question here, I've searched for a while but cannot find a proper example - if I wanted to set
So how would that look like when doing a Once again, thank you so much for help! Would appreciate an example with Cheers, |
Glad that it worked. For environment variable, it should be set |
Oh that: Huge thank you one more time. Have a great day! |
What happened?
Hello there, hope you guys are doing all right!
We're currently working on providing support for WebView2 applications in our software, and I think we encountered an issue. WebView2 applications expose a CDP server through port 9222 (we followed the tutorial here re editing registers https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/debug-visual-studio-code). There are kinda two problems though:
now when changing the
host
tohttp://localhost
, I'm getting different debugger endpoints:The first one, "Widgets", most probably comes with MS Outlook, whilst the other is one of your official samples (x64) which we're using for tests.
When checking what's going on on port 9222, this is what I'm seeing, which's also quite disturbing:
The question here: shouldn't WebView2 Runtime/Manager/Whatever somehow figure out that the CDP server has already been started and somehow "attach" the new application there? Or else, how are we supposed to know which URL to query? I guess that if the PID would've been supplied together with the debugger URL, we could somehow do an exhaustive search over both addresses (given the start properly, as per point 2!), but it's not there. The experimental CDP API for getting the process info (https://chromedevtools.github.io/devtools-protocol/tot/SystemInfo/#method-getProcessInfo) does not seem to be working either.
The workaround for now would be to kill all processes occupying port 9222 (
npx-kill port 9222
for example) and then immediately start the process we're interested in. What we're seeing throughhttp://localhost:9222
is the what we expect. But as you may imagine, this is not ideal...Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
126.0.2592.113
SDK Version
1.0.2646-prerelease
Framework
Win32
Operating System
Windows 11
OS Version
10.0.22621
Repro steps
http://127.0.0.1:9222/json
in your favorite browser, then queryhttp://localhost/json
and notice that the JSON is different and different debugger URLs are reported.Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
Don't know
Last working version (if regression)
No response
AB#52885780
The text was updated successfully, but these errors were encountered: