We have updated our Privacy Notice, you can read the updated document here
Mods please check the Moderators Group for an important update on Mod tools. If you do not have access to the group, please PM Niamh. Thanks!

Limiting ASP.net application to just Windows

  • #2
    Registered Users Posts: 3,615 ✭✭✭ 10000maniacs


    Is there a setting to just allow an ASP.net application to run on Windows and exclude mobile devices and Apple? Maybe going to a generic error page when the wrong device is chosen.
    The compliance people have said if we allow IPhones and Galaxy, they have to be fully tested on both platforms. We don't have the testing resources to do that.


Comments

  • #2


    Yes, you can query the User-Agent header sent by the browser.

    https://docs.microsoft.com/en-us/dotnet/api/system.web.httprequest.useragent?view=netframework-4.8

    It's not an exact science, the user-agent is basically a freetext field so the browser could send anything. But 99% of your traffic will be identifiable by platform.


  • #2


    Thanks Seamus


  • #2


    Would strongly recommend against doing that. User-agent restrictions are years out of date, and weren't a good idea even when they were common. You're almost certain to get both false positives and false negatives, and you end up with a game of whack-a-mole maintaining a ever-increasing list of black and whitelists.

    Sounds like your compliance people don't know their arse from their elbow tbh. You don't deliberately break a site based on what you think a user might be running. You publish a whitelist of supported configurations, (Windows 7+, Firefox 78+/Chrome 90+/IE6+ (joke!), resolution 1024x600 etc.), and then don't provide any support for users outside those. If it works for them anyway, great, if not, they're on their own until they switch to a supported config.

    Boardsie Enhancement Suite - a browser extension to make using post-migration Boards on desktop a better experience (includes full-width display, keyboard shortcuts, and a dark mode setting)



  • #2


    28064212 wrote: »
    Would strongly recommend against doing that. User-agent restrictions are years out of date, and weren't a good idea even when they were common. You're almost certain to get both false positives and false negatives, and you end up with a game of whack-a-mole maintaining a ever-increasing list of black and whitelists.

    Sounds like your compliance people don't know their arse from their elbow tbh. You don't deliberately break a site based on what you think a user might be running. You publish a whitelist of supported configurations, (Windows 7+, Firefox 78+/Chrome 90+/IE6+ (joke!), resolution 1024x600 etc.), and then don't provide any support for users outside those. If it works for them anyway, great, if not, they're on their own until they switch to a supported config.

    I eventually ended up using:
    HTTPBrowserCapabilities = HTTPContext.Current.Request.Browser + Platform()
    All modern Windows Operating systems return "WinNT" on that call.


Society & Culture