5 ms·
Not sure why you're being downvoted, but this is exactly the reason. Chrome on Windows includes "Safari" in the user agent and Chrome on Android includes "Mobil
by ladberg 6y ago
Not sure why you're being downvoted, but this is exactly the reason. Chrome on Windows includes "Safari" in the user agent and Chrome on Android includes "Mobile Safari" because if they don't add it, tons of websites will break.
Everyone does this, which is kinda why we need to get rid of user agents and replace it with feature detection (and css that works everywhere for people who don't want to run Javascript).
- baggy_trough 6y agoBrowsers have bugs so it's not really possible to do that and maintain a reliable web.
- alerighi 6y agoBugs should be fixed by who produces the browser and not by the website administrator by looking at the user agent and using workarounds. When someone asks me to build I site for them I say, look I will guarantee that the site that I make is compliant with the W3C specification. If there is something that it doesn't work because some browser don't implement the standard correctly, you go to Microsoft to complain, or you install a decent browser like Firefox.
- baggy_trough 6y agoI admire your idealism, but here on planet Earth engineers are paid to make things work.
- kortilla 6y agoLol, I don’t know who your clientele are but producing websites that don’t work on popular browsers “because the browser is not following spec” is a non-starter. A bank wants a banking website its customers can use, not a website 60% of its customers can use and a link to a 7 year old bug report.
- sdinsn 6y agoDisagree. You can't just tell your customers "my product doesn't work because of Microsoft, go complain to them; even though it's possible for me to work around it, I'm choosing not to".
- account42 6y agoHave you tried?
- AnonC 6y ago> Bugs should be fixed by who produces the browser and not by the website administrator by looking at the user agent and using workarounds. IE 6 had such a history where it held back other browsers and developers were held hostage to it for several years. Now we have Chrome to fill that gap and some Google platforms won’t work well or work the same on Firefox.
- ladberg 6y agoThen part of feature detection could be detecting bugs and working around them. This wouldn't have to be done by every web developer, but bundled into a commonly used library so cruft can be taken out when browsers fix bugs.
- baggy_trough 6y agoHow would that library be any better than using user agent strings? I think it would likely be worse.
- ladberg 6y agoIf a browser updates with a new feature that Chrome already has and other sites already use, the users get to use the new feature with no update from the developers due to feature detection.
- baggy_trough 6y agoI don't disagree with you on feature detection, but there is no feasible way to encode all browser bugs that require workarounds into a library. By nature, these are usually extremely niche.
- deleted 6y ago[deleted]
- toast0 6y agoJavascript feature detection is much too late when you need to send headers with the HTML and browser vendors can't agree on the header values or change their mind on what things mean. Like the samesite cookie nonsense: https://www.chromium.org/updates/same-site/incompatible-clients https://www.chromium.org/updates/same-site/incompatible-clie... Assuming things like that continue to happen, what are web developers supposed to do? I propose a Real-Agent header that includes browser name and version, os name and version, cpu type (maybe) and desktop/mobile flag (maybe). Or separate headers for each name/version data, I don't care, I just know I need real data sometimes, and some new weird server request pattern isn't going to work well. Then continue to send shakespearean sonnets in user-agent for all I care.