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
Closed

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

kshyju opened this issue Jan 25, 2019 · 6 comments

Comments

@kshyju
Copy link

@kshyju kshyju 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
Copy link
Member

@Eilon Eilon 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.

Loading

@Eilon Eilon closed this Jan 26, 2019
@kshyju
Copy link
Author

@kshyju kshyju commented Jan 28, 2019

Thanks Eilon

Loading

@tb-mtg
Copy link

@tb-mtg tb-mtg commented Apr 16, 2019

@kshyju What alternative did you end using?

Loading

@kshyju
Copy link
Author

@kshyju kshyju commented Apr 16, 2019

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

Loading

@kshyju
Copy link
Author

@kshyju kshyju 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.

Loading

@kshyju
Copy link
Author

@kshyju kshyju commented Aug 30, 2019

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

Loading

@msftbot msftbot bot locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants