Skip to content

Fixed devtools url used for debug with chrome and edge #61813

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 5 commits into from
May 15, 2025

Conversation

Dona278
Copy link
Contributor

@Dona278 Dona278 commented May 6, 2025

This PR ensure the correct creation of the devtools url with proxy to use for debug with chrome and edge browser which recently changed how urls are returned from "localhost:9222/json".

Browser tested:
Edge Version 136.0.3240.50
Chrome Version 136.0.7103.49

Fixes #61559

@Dona278 Dona278 requested a review from a team as a code owner May 6, 2025 15:36
@ghost ghost added the area-blazor Includes: Blazor, Razor Components label May 6, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label May 6, 2025
@thaystg
Copy link
Member

thaystg commented May 8, 2025

I'm comfortable on approving the PR with the suggestions that @ilonatommy did, and also @ilonatommy if you have time can you give a double test? Maybe with an old and a new chrome/edge version?
Please let me know, if you don't have time to do it I'll try.

@javiercn
Copy link
Member

javiercn commented May 8, 2025

@thaystg I'm not an expert in this area, so if you think the change is good enough, I'm happy with it.

Do you know if this affects debugging under VS or is this just for debugging directly from the dev tools?

@Dona278
Copy link
Contributor Author

Dona278 commented May 8, 2025

If can help: with that change, VS debug still works, and because all stuffs are under "display browser debug information" context and are based only on what browser returns back if lanched with specific command, I think that VS debugging isn't affected.
Meanwhile I will update the code to reflect your the suggestions.

@Dona278
Copy link
Contributor Author

Dona278 commented May 8, 2025

@thaystg after applied suggestions I saw that the code can be changed to a simple "if it is already correct use as is, othewise keep its query string and append to the default browser devtools path". I also added comment which explain that with example of new (both chrome and edge) and old version. @javiercn now I think it is more clear the reason why.

Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes, it's much simpler and clearer now. I only have one remaining piece of feedback about using UriHelper.FromAbsolute instead of manually processing the URL as that is "safer" and more future proof.

@thaystg
Copy link
Member

thaystg commented May 8, 2025

@thaystg I'm not an expert in this area, so if you think the change is good enough, I'm happy with it.

Do you know if this affects debugging under VS or is this just for debugging directly from the dev tools?

This does not affect VS debugger.

Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@Dona278
Copy link
Contributor Author

Dona278 commented May 10, 2025

Will be also backported to next net9 release?

@ilonatommy
Copy link
Member

@thaystg, I'm catching up after the holidays, I don't think I can test it any soon. CI failures are not connected.

@javiercn javiercn merged commit f0a43e8 into dotnet:main May 15, 2025
27 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview5 milestone May 15, 2025
@javiercn
Copy link
Member

javiercn commented May 15, 2025

@Dona278 thanks for the contribution!

@ilonatommy let's get this into preview5 and we can see about backporting it later. I've just triggered the PR so that it's ready should we want to do it.

@javiercn
Copy link
Member

/backport to release/9.0

Copy link
Contributor

Started backporting to release/9.0: https://github.com/dotnet/aspnetcore/actions/runs/15042046220

@Dona278 Dona278 deleted the fix-chrome-edge-debug branch May 15, 2025 10:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-blazor Includes: Blazor, Razor Components community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blazor WebAssembly browser debugging fails with UriFormatException using recent Chrome versions
4 participants