WICG / ua-client-hints

Wouldn't it be nice if `User-Agent` was a (set of) client hints?
https://wicg.github.io/ua-client-hints/
Other
590 stars 77 forks source link

What's the definition of mobile field? #329

Closed woody-li closed 1 year ago

woody-li commented 1 year ago

What's the exact value of mobile field on a tablet device? Is the field refer to phone devices only?

I tested on Android Chorme, got true on phone but false on tablet.

Tablet data:

{
  brands: [
    { brand: 'Not_A Brand', version: '99'  },
    { brand: 'Google Chrome', version: '109' },
    { brand: 'Chromium', version: '109' },
  ],
  mobile: false,
  platform: 'Android',
}
miketaylr commented 1 year ago

That will depend on each browser - Chrome for Android on a tablet device does not include the "Mobile" token in the UA: https://developer.chrome.com/docs/multidevice/user-agent/#chrome-for-android, but Firefox has had a "Tablet" token (at least historically - not sure if they removed it): https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox#mobile_and_tablet_indicators

woody-li commented 1 year ago

Thanks for your reply. Known it depends browser implements. Want to know what's the definition in standard specification.

miketaylr commented 1 year ago

I think we can consider this a duplicate of #333.