3 ms·
User agent sniffing is poor practice anyways. Try to use the feature and react according to the browser's abilities. Analytics and similar can sniff all day tho
by andirk 4y ago
User agent sniffing is poor practice anyways. Try to use the feature and react according to the browser's abilities. Analytics and similar can sniff all day though.
To push browsers to get rid of UA string, we should all use a UA string extension that uses the same string like "DOG-SHIT". That way it'll start showing up in analytics.
And if you're trying to date the "data science" girl, spam the app/website with UA string like "hi-amy-will-you-go-out-with-me--sincerely-jack-who-sits-behind-you."
- altdataseller 4y agoFor your last point: that would be considered cute if you're attractive. Otherwise it's creepy.
- jeroenhd 4y agoHave more fun with your UA strings! Unclosed quotation marks, XXE strings, Shellshock, they might just earn you a bug bounty. Maybe throw in the EICAR test string as well, getting their shitty antivirus to purge the log files may just help protect your privacy!
- xyzzy_plugh 4y agoNah, you're both wrong. What you really want is social security numbers.
- wkat4242 4y agoLog4j would also be an interesting one there
- gregmac 4y agoDoes anyone know of (or work on) an app still doing user-agent sniffing to determine browser features (as in, the sniffing code has been touched in the last ~decade)? If so, why do it that way?
- oefrha 4y agoUser agent sniffing is still a very typical way to determine whether to send the mobile or desktop version of a site.
- rikschennink 4y agoI do. Lots of `isIOS` and `isSafari` tests in my code. Safari 15 for example cannot correctly apply orientation metadata, and will choke on very big images when using `createImageBitmap` in a thread. No way to find out. I could probably detect the orientation issue with a small dataURI of an image, but the big image issue is more difficult.
- tgv 4y agoSo it turned out that Chrome 93-95 had a weird issue with the video element: you couldn't replace the source attribute reliably. Unfortunately, that's something that mattered to us, so I had a hack in place that tested the browser version. It's still there in case someone hasn't updated their browser. Testing the feature was simply not possible. It was either that or just let (a large) part of our users get stuck on a frozen screen.
- Pathogen-David 4y agoYup, the "test for feature availability" attitude doesn't properly account for features which are available yet buggy. I recently ran into an issue where a media-heavy blog post of mine would sporadically crash iOS Safari. I ended up narrowing it down to my use of ImageBitmap to accelerate rendering images into 2D canvases on the page. My fix ended up being to modify my ImageBitmap feature check to pretend it wasn't supported on Safari.
- sebazzz 4y agoFeature testing is a lot harder when attempting to work around CSS bugs in cough cough Safari, unless you use weird things like @supports (<insert feature that vCurrent mobile Safari doesn't support but all other current browsers do>) and then hope it is fixed in a future Safari.
- andirk 4y ago_cough cough_ MediaSource. Mobile Safari is now completely the new IE. It's so sad.