-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'mobile' client hint to explainer and spec #8
Conversation
@@ -127,6 +128,13 @@ accomplish this as follows: | |||
```http | |||
Sec-CH-UA-Model: "Pixel 2 XL" | |||
``` | |||
|
|||
5. The `Sec-CH-UA-Mobile` header field represents whether the user agent should receive a specifically "mobile" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Browsers distinguish between more than just Mobile or not Mobile -- there are also VR
(and sometimes Mobile VR
(some oculus and samsung devices) and TV
<devicecompat>
tokens (my phrase, I think Samsung calls it "UX RECOMMEND") in user agent strings, depending on form factor. Rather than a new boolean for each of those, it's probably better to abstract over that, if this extension seems useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Framing it in terms of UX recommendations might make sense. I like that semantic more than "This is mobile."
I wonder what granularity we could reasonably provide by default, though. This hint only makes sense if we're sending it by default, as developers can of course request actual viewport information directly. I worry that too many buckets will add enough entropy to make it unlikely we'd benefit users by shipping this without an opt-in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was considering this too; making an enum or list of values as opposed to just a boolean. I liked that it was just one bit of information, but it may not be useful.
I do agree with @mikewest that if we make it an enum or even just a string, the balance of of entropy to usability will be rough. I also worry that feature creep might turn it into a mess of different values, way too specific values, and general compat mess.
There's also the issue that if someone decides to make a new value, no one else will use it and the default might be more or less useful than another more popular option (like if you're on a TV and the "mobile" version might be more useful the "desktop" version).
We could set up a preference order (like font-families in CSS), although that might make for more fingerprinting (?) it would make graceful failing of unknown values better.
@amtunlimited - Can you join the WICG and link your GH account with your W3C one to appease the IPR bots? |
Done |
@yoavweiss I appeased the bots. Sorry it took so long, I didn't realize you had to manually re-validate (and log in to do so) |
Would you mind reformulating this PR against https://github.com/WICG/ua-client-hints/blob/master/index.bs? We're moving out of IETF and into Bikeshed... should be simple to pull it across, but apologies for the inconvenience! |
No worries. It seems to be just markdown with some sugar on it, yes? |
Yup. Just a different kind of markdown than before. You should be able to
copy and paste the sugary bits from the other header definitions. Thanks!
Sorry!
|
That ought to do it? Had a weird merge conflict, I think it didn't like that I rebased in a weird way? IDK, but we're good now. Check my bikeshed though, I'm just going by example. |
There does seem to be some merging weirdness. The diff looks very strange... I'll see what I can do about cleaning it up. |
I pushed some small changes directly this morning, just to test the travis auto-publish setup (spoiler: it is not working). If that's the source of weirdness, feel free to nuke them |
I noticed. :) I merged this manually. Hopefully we didn't lose anything interesting along the way... |
Mobile is a boolean client hint that informs whether a "mobile" or "desktop" user experience should be supplied. Relevant changes to the spec can be found here: WICG/ua-client-hints#8 That was manually added via this commit: WICG/ua-client-hints@db6fab2 Bug: 928669 Change-Id: Ia983cfa516c28b6a747b270abcc44e71ed39e1b5
Mobile is a boolean client hint that informs whether a "mobile" or "desktop" user experience should be supplied. Relevant changes to the spec can be found here: WICG/ua-client-hints#8 That was manually added via this commit: WICG/ua-client-hints@db6fab2 Bug: 928669 Change-Id: Ia983cfa516c28b6a747b270abcc44e71ed39e1b5
Mobile is a boolean client hint that informs whether a "mobile" or "desktop" user experience should be supplied. Relevant changes to the spec can be found here: WICG/ua-client-hints#8 That was manually added via this commit: WICG/ua-client-hints@db6fab2 Bug: 928669 Change-Id: Ia983cfa516c28b6a747b270abcc44e71ed39e1b5
Mobile is a boolean client hint that informs whether a "mobile" or "desktop" user experience should be supplied. Relevant changes to the spec can be found here: WICG/ua-client-hints#8 That was manually added via this commit: WICG/ua-client-hints@db6fab2 Bug: 928669 Change-Id: Ia983cfa516c28b6a747b270abcc44e71ed39e1b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829793 Commit-Queue: Aaron Tagliaboschi <aarontag@chromium.org> Reviewed-by: Yoav Weiss <yoavweiss@chromium.org> Reviewed-by: Dominick Ng <dominickn@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org> Cr-Commit-Position: refs/heads/master@{#723037}
Mobile is a boolean client hint that informs whether a "mobile" or "desktop" user experience should be supplied. Relevant changes to the spec can be found here: WICG/ua-client-hints#8 That was manually added via this commit: WICG/ua-client-hints@db6fab2 Bug: 928669 Change-Id: Ia983cfa516c28b6a747b270abcc44e71ed39e1b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829793 Commit-Queue: Aaron Tagliaboschi <aarontag@chromium.org> Reviewed-by: Yoav Weiss <yoavweiss@chromium.org> Reviewed-by: Dominick Ng <dominickn@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org> Cr-Commit-Position: refs/heads/master@{#723037}
Automatic update from web-platform-tests Implement `Sec-CH-UA-Mobile` Mobile is a boolean client hint that informs whether a "mobile" or "desktop" user experience should be supplied. Relevant changes to the spec can be found here: WICG/ua-client-hints#8 That was manually added via this commit: WICG/ua-client-hints@db6fab2 Bug: 928669 Change-Id: Ia983cfa516c28b6a747b270abcc44e71ed39e1b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829793 Commit-Queue: Aaron Tagliaboschi <aarontag@chromium.org> Reviewed-by: Yoav Weiss <yoavweiss@chromium.org> Reviewed-by: Dominick Ng <dominickn@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org> Cr-Commit-Position: refs/heads/master@{#723037} -- wpt-commits: 98e81ec707999187b087b3671e93a3625188b35a wpt-pr: 19701
Automatic update from web-platform-tests Implement `Sec-CH-UA-Mobile` Mobile is a boolean client hint that informs whether a "mobile" or "desktop" user experience should be supplied. Relevant changes to the spec can be found here: WICG/ua-client-hints#8 That was manually added via this commit: WICG/ua-client-hints@db6fab2 Bug: 928669 Change-Id: Ia983cfa516c28b6a747b270abcc44e71ed39e1b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829793 Commit-Queue: Aaron Tagliaboschi <aarontagchromium.org> Reviewed-by: Yoav Weiss <yoavweisschromium.org> Reviewed-by: Dominick Ng <dominicknchromium.org> Reviewed-by: Avi Drissman <avichromium.org> Reviewed-by: Takashi Toyoshima <toyoshimchromium.org> Cr-Commit-Position: refs/heads/master{#723037} -- wpt-commits: 98e81ec707999187b087b3671e93a3625188b35a wpt-pr: 19701 UltraBlame original commit: a75eb297546190b81743b4452c12a79e7e87aa53
Automatic update from web-platform-tests Implement `Sec-CH-UA-Mobile` Mobile is a boolean client hint that informs whether a "mobile" or "desktop" user experience should be supplied. Relevant changes to the spec can be found here: WICG/ua-client-hints#8 That was manually added via this commit: WICG/ua-client-hints@db6fab2 Bug: 928669 Change-Id: Ia983cfa516c28b6a747b270abcc44e71ed39e1b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829793 Commit-Queue: Aaron Tagliaboschi <aarontagchromium.org> Reviewed-by: Yoav Weiss <yoavweisschromium.org> Reviewed-by: Dominick Ng <dominicknchromium.org> Reviewed-by: Avi Drissman <avichromium.org> Reviewed-by: Takashi Toyoshima <toyoshimchromium.org> Cr-Commit-Position: refs/heads/master{#723037} -- wpt-commits: 98e81ec707999187b087b3671e93a3625188b35a wpt-pr: 19701 UltraBlame original commit: a75eb297546190b81743b4452c12a79e7e87aa53
Automatic update from web-platform-tests Implement `Sec-CH-UA-Mobile` Mobile is a boolean client hint that informs whether a "mobile" or "desktop" user experience should be supplied. Relevant changes to the spec can be found here: WICG/ua-client-hints#8 That was manually added via this commit: WICG/ua-client-hints@db6fab2 Bug: 928669 Change-Id: Ia983cfa516c28b6a747b270abcc44e71ed39e1b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829793 Commit-Queue: Aaron Tagliaboschi <aarontagchromium.org> Reviewed-by: Yoav Weiss <yoavweisschromium.org> Reviewed-by: Dominick Ng <dominicknchromium.org> Reviewed-by: Avi Drissman <avichromium.org> Reviewed-by: Takashi Toyoshima <toyoshimchromium.org> Cr-Commit-Position: refs/heads/master{#723037} -- wpt-commits: 98e81ec707999187b087b3671e93a3625188b35a wpt-pr: 19701 UltraBlame original commit: a75eb297546190b81743b4452c12a79e7e87aa53
Automatic update from web-platform-tests Implement `Sec-CH-UA-Mobile` Mobile is a boolean client hint that informs whether a "mobile" or "desktop" user experience should be supplied. Relevant changes to the spec can be found here: WICG/ua-client-hints#8 That was manually added via this commit: WICG/ua-client-hints@db6fab2 Bug: 928669 Change-Id: Ia983cfa516c28b6a747b270abcc44e71ed39e1b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829793 Commit-Queue: Aaron Tagliaboschi <aarontag@chromium.org> Reviewed-by: Yoav Weiss <yoavweiss@chromium.org> Reviewed-by: Dominick Ng <dominickn@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org> Cr-Commit-Position: refs/heads/master@{#723037} -- wpt-commits: 98e81ec707999187b087b3671e93a3625188b35a wpt-pr: 19701
Add a boolean "mobile" client hint to the explainer and spec, which should cover a very large use case while revealing less entropy and acknowledging user preferences on the matter.
Possible questions include: