Closed Bug 906538 Opened 11 years ago Closed 11 years ago

[Flatfish] Update user agent for large device

Categories

(Firefox OS Graveyard :: General, defect)

Other
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gasolin, Assigned: viralwang)

References

Details

Attachments

(1 file, 1 obsolete file)

refer to https://github.com/gaia-local/gaia/issues/109

We should change user agent to fit large device browsing.

maybe provide with customization(too flexible), or from gecko?
Blocks: flatfish
We should open a discussion on this at the compat meeting and on dev-b2g on what UA we want for Firefox OS tablets. Adding some guys to the cc list as such who would have an opinion on this.
Could someone give more background about the issue? Both here and github do not give a summary of the issue we are trying to solve.
The "obvious" UA for a Firefox OS tablet is one which takes the Firefox OS UA from <https://wiki.mozilla.org/B2G/User_Agent>:

Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0

and replaces "Mobile" with "Tablet", as we have done on Android. So:

Mozilla/5.0 (Tablet; rv:18.0) Gecko/18.0 Firefox/18.0

This would fit with our current UA strategy.

Gerv
(In reply to Gervase Markham [:gerv] from comment #3)
> The "obvious" UA for a Firefox OS tablet is one which takes the Firefox OS
> UA from <https://wiki.mozilla.org/B2G/User_Agent>:
> 
> Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0
> 
> and replaces "Mobile" with "Tablet", as we have done on Android. So:
> 
> Mozilla/5.0 (Tablet; rv:18.0) Gecko/18.0 Firefox/18.0
> 
> This would fit with our current UA strategy.
> 
> Gerv

That makes sense. Since I expect this question to come up - if an operator enforces having device information in the user agent for a tablet, what UA should we suggest in that case?
Comment 3 captures my thoughts as well. 

(In reply to Jason Smith [:jsmith] from comment #4)
> That makes sense. Since I expect this question to come up - if an operator
> enforces having device information in the user agent for a tablet, what UA
> should we suggest in that case?

If the device is wifi only, this may not be an issue. Do we know if the device will include a data connection?
(In reply to Jason Smith [:jsmith] from comment #4)
> That makes sense. Since I expect this question to come up - if an operator
> enforces having device information in the user agent for a tablet, what UA
> should we suggest in that case?

Same modification that we make for a phone - between "Tablet" and "rv". But really, tablets get desktop sites, and desktop sites already need to cope with a variety of screen sizes. The arguments for a device identifier in this case are even weaker.

Gerv
Component: Gaia → General
(In reply to Lawrence Mandel [:lmandel] from comment #5)
> Comment 3 captures my thoughts as well. 
> 
> (In reply to Jason Smith [:jsmith] from comment #4)
> > That makes sense. Since I expect this question to come up - if an operator
> > enforces having device information in the user agent for a tablet, what UA
> > should we suggest in that case?
> 
> If the device is wifi only, this may not be an issue. Do we know if the
> device will include a data connection?

Flatfish is wifi only.
OK. Then I think the UA in Comment 3 is the right one.

Gerv
(In reply to Gervase Markham [:gerv] from comment #9)
> OK. Then I think the UA in Comment 3 is the right one.

I concur.
viral, 

do we have to change default user-agent to 'Mozilla/5.0 (Tablet; rv:26.0) Gecko/26.0 Firefox/26.0' from gecko side? (I think B2G 1.2 use gecko 26, right?)

https://github.com/gaia-local/gaia/issues/109 only override some sites that not shown properly with the default user-agent.
Flags: needinfo?(vwang)
(In reply to Fred Lin [:gasolin] from comment #11)
> viral, 
> 
> do we have to change default user-agent to 'Mozilla/5.0 (Tablet; rv:26.0)
> Gecko/26.0 Firefox/26.0' from gecko side? (I think B2G 1.2 use gecko 26,
> right?)
> 
> https://github.com/gaia-local/gaia/issues/109 only override some sites that
> not shown properly with the default user-agent.

Yes, we need automatic detection of tablets in gecko, like we do for android. I first approximation could be to consider any device with a screen larger than 7" to be a tablet.
for reference, in gaia we use 768px to distinguish phone/tablet size device (value comes from bootstrap 3)
(In reply to Fred Lin [:gasolin] from comment #13)
> for reference, in gaia we use 768px to distinguish phone/tablet size device
> (value comes from bootstrap 3)

Are these css pixels or device pixels?
css pixels
(In reply to Fred Lin [:gasolin] from comment #11)
> do we have to change default user-agent to 'Mozilla/5.0 (Tablet; rv:26.0)
> Gecko/26.0 Firefox/26.0' from gecko side? (I think B2G 1.2 use gecko 26,
> right?)

I'm not sure what you are asking, but: the user agent is constructed automatically from what Firefox knows about itself. As long as you make sure it knows it's a tablet, the UA should come out fine.

Gerv
I'm thinking about this is device dependency issue.
We already check the system-info to have correct user agent in nsHttpHandler::InitUserAgentComponents().
However, "tablet" property can only set when MOZ_WIDGET_ANDROID is defined.
All we need to do is to support in MOZ_WIDGET_GONK is defined in nsSystemInfo::Init().
Flags: needinfo?(vwang)
Hi Fabrice,

I think we can use ro.build.characteristics to check which device it is.
If it is "tablet" and we can set user agent to "Tablet", otherwise, keep the "Mobile" as we did before.
Attachment #806547 - Flags: review?(fabrice)
Attachment #806547 - Flags: review?(fabrice) → review+
add reviewer in the comment of the patch
Assignee: nobody → vwang
Attachment #806547 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/5ec7b5e48764
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: