Skip to content
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

HttpContext.Request.Browser in asp.net core #7033

Closed
kshyju opened this issue Jan 25, 2019 · 6 comments

Comments

@kshyju
Copy link

commented Jan 25, 2019

Is there an alternative in the asp . net core world for HttpContext.Request.Browser ? .net framework 4.7.2 has this.

If no plans, to add, would you mind sharing the rationale behind that ? recommended alternate solutions ?

@Eilon

This comment has been minimized.

Copy link
Member

commented Jan 26, 2019

Hi, the browser caps feature in ASP.NET 4.x was a server-based way of doing client feature detection. This approach is generally frowned upon in the "modern" era, where runtime client-side feature detection is preferred, using techniques such as progressive enhancement. For that reason, in addition to being a huge maintenance cost to keep the list even reasonably up-to-date, the feature was not brought forward to ASP.NET Core.

@Eilon Eilon closed this Jan 26, 2019

@kshyju

This comment has been minimized.

Copy link
Author

commented Jan 28, 2019

Thanks Eilon

@tb-mtg

This comment has been minimized.

Copy link

commented Apr 16, 2019

@kshyju What alternative did you end using?

@kshyju

This comment has been minimized.

Copy link
Author

commented Apr 16, 2019

Ended up writing something which parses user agent string to do this.

@kshyju

This comment has been minimized.

Copy link
Author

commented Aug 30, 2019

There are some valid use cases where browser detection is needed (Example: a proxy server which can do specific routing based browser information). I created a light weight library to do this and published as a nuget package.

Follow steps outlined here to use it.

@kshyju

This comment has been minimized.

Copy link
Author

commented Aug 30, 2019

@tb-mtg I have published the solution I used as a nuget package. See above response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.