compat icon indicating copy to clipboard operation
compat copied to clipboard

Issues with <deviceCompat>

Open domenic opened this issue 3 years ago • 2 comments

https://compat.spec.whatwg.org/#ua-string-pattern-chrome says

<legacyMozillaVersion> (<platform>; <oscpu>) <frozenWebKitVersion> Chrome/<chromeVersion> <deviceCompat> <frozenSafariVersion>

but this gives the wrong results for <deviceCompat> being the empty string or "Mobile " (with a trailing space, like the introductory section mentions).

Safari's section has the same issue. Additionally, Safari seems to have a <deviceCompat> of Mobile/15E148, which doesn't fit the format mentioned in the introduction. Although the introduction is non-exhaustive I think it'd be good to mention a format used by a prominent mobile browser.

domenic avatar Feb 01 '22 17:02 domenic

Oh, the first half of this is maybe a dupe of #167.

domenic avatar Feb 01 '22 18:02 domenic

Chrome has been since fixed to say>

"Mozilla/5.0 (<chromePlatform>) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/<majorVersion>.0.0.0 <deviceCompat>Safari/537.36"

And right now the Token Reference has this to say about <deviceCompat>,

Represents the form-factor of the device. Primarily this is "Mobile ", or just the empty string, for Desktop or non-mobile devices. Some browsers have also sent token values such as "Tablet", "TV", "Mobile VR", etc., or included build information as well.

So maybe the original issues have been addressed? But I think further improvements are still possible.

miketaylr avatar Aug 03 '22 01:08 miketaylr