[whatwg] Adding a property to navigator for getting device model

Hi All,

Right now all mobile browsers expose the mobile device model through
the UA string.

There are lots of us, me included, that wish that we could stop doing
this. The problems are at least:

* Exposes more finger printing bits. (I'm aware that people feel
differently about how big of a problem this is).
* Lots of websites key various things off of UA string, even when they
don't care about device models. These will not recognize the UA if
it's even slightly off from what they know which can cause them to
fall back to a generic HTML4 (or even WAP) version of the website.
* Parsing just the device model identifier from the UA string is error prone.
* Encourages websites to do feature detection through UA detection,
rather than through, well, feature detection.

In some cases websites uses the UA strings for bad reasons ("this is
how we've always done it"), in other cases because it's literally the
best way for them to create a good user experience for their users.

I've tried for a while to try to figure out features that we can add
to the web platform to try to slowly move away the industry from this
practice. But it's a very slow process. And actually getting websites
to stop using the UA string in this manner is going to be even slower
as it's very entrenched in the mobile industry.

In the meantime, I'd like to add a property to window.navigator to
enable websites to get the same information from there as is already
available in the UA string. That would at least help with the parsing
problem.

And if means that we could more quickly move the device model out of
the UA string, then it also helps with the UA-string keying thing.

Obviously I'm not suggesting that UAs be required to set this
property. At least Mozilla would not set this property in
distributions where we are not currently sending a device model in the
UA string.

I'm just suggesting that on platforms where various browsers are
*already* exposing a device model through the UA string. That we
expose the same information in a more easy-to-consume property in the
DOM.

My suggested name would be navigator.deviceModel

Thoughts?

/ Jonas

Received on Wednesday, 24 September 2014 01:55:26 UTC