Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29516656: Issue 5347 - Add geckoInfo.deviceForm for phone and tablet (Closed)

Created:
Aug. 15, 2017, 4:11 p.m. by Manish Jethani
Modified:
Aug. 16, 2017, 8:24 p.m.
Reviewers:
Sebastian Noack
Base URL:
https://hg.adblockplus.org/buildtools/
Visibility:
Public.

Description

Issue 5347 - Add geckoInfo.deviceForm for phone and tablet Rationale: info.application and info.applicationVersion are available only later, after a lot of code has already been initialized. We need this info sooner so we avoid running a lot of unnecessary code. Besides, the application name "Fennec" doesn't really tell us if it's on mobile or tablet, and we might want to do different things based on the device form factor, either now or in the future. I've added a info.deviceForm property that can have the values "unknown" (default), "phone", or "tablet". The parsing of the UA string is based on the specification here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox The name and possible values of the new property are inspired by this: https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-deployment-deviceform

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -2 lines) Patch
M templates/geckoInfo.js.tmpl View 1 chunk +14 lines, -2 lines 0 comments Download

Messages

Total messages: 7
Manish Jethani
Aug. 15, 2017, 4:11 p.m. (2017-08-15 16:11:15 UTC) #1
Manish Jethani
Rationale: info.application and info.applicationVersion is available only later, after a lot of code has already ...
Aug. 15, 2017, 4:15 p.m. (2017-08-15 16:15:59 UTC) #2
Manish Jethani
On 2017/08/15 16:15:59, Manish Jethani wrote: > I've added a info.deviceForm property that can have ...
Aug. 15, 2017, 4:17 p.m. (2017-08-15 16:17:38 UTC) #3
Sebastian Noack
runtime.getPlatformInfo() provides a more reliable way to detect the OS, since the user agent string ...
Aug. 15, 2017, 4:31 p.m. (2017-08-15 16:31:17 UTC) #4
Manish Jethani
On 2017/08/15 16:31:17, Sebastian Noack wrote: > runtime.getPlatformInfo() provides a more reliable way to detect ...
Aug. 15, 2017, 4:44 p.m. (2017-08-15 16:44:08 UTC) #5
Manish Jethani
On 2017/08/15 16:44:08, Manish Jethani wrote: > On 2017/08/15 16:31:17, Sebastian Noack wrote: > > ...
Aug. 15, 2017, 4:53 p.m. (2017-08-15 16:53:04 UTC) #6
Sebastian Noack
Aug. 15, 2017, 5:02 p.m. (2017-08-15 17:02:21 UTC) #7
On 2017/08/15 16:53:04, Manish Jethani wrote:
> We could also just use chrome.windows as a proxy. If it's null, it's mobile.

Sounds like a fair compromise, if it has to be synchronous. It's possible though
that they will implement the "windows" API on Android at some point, but it's at
least not any less reliable than the user agent string (and much simpler to
check).

Powered by Google App Engine
This is Rietveld