Closed Bug 1313522 Opened 8 years ago Closed 8 years ago

user agent set to tablet on phone

Categories

(Firefox for Android Graveyard :: General, defect)

50 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: kahing, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0
Build ID: 20161024172922

Steps to reproduce:

After setting Android setting "Display / Display size" to "Small", firefox starts reporting "Tablet" in the user agent, which causes many websites (ex: news.google.com) to send desktop version of the site.

I am using Google Pixel now but saw the same behavior under Nexus 5x as well.


Actual results:

news.google.com sends desktop version of the site


Expected results:

Chrome under the same setting gets mobile version of news.google.com
This is expected behavior. This forces the tablet interface, thus you get the tablet UA. If you would like to override it you can set general.useragent.override to Mozilla/5.0 (Android 7.0; Mobile; rv:49.0) Gecko/49.0 Firefox/49.0 in about:config. 

You will need to periodically update the version numbers as websites may complain if you claim to be using too old a browser.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
I realized that firefox switched to the tablet interface, but isn't it a bug that chrome and firefox don't show the same version of a site?
No. Google controls the servers that are responding to the request to fetch the website. It may be a Google News bug. It is not a Firefox for Android bug.
but Firefox is the one telling Google News that it's a tablet. On my actual tablet, both firefox and Chrome are showing the desktop interface (as expected).
Can you help me understand the logic for making a phone with display size small use the tablet user agent? On top of this behavior appearing to be arbitrary and incorrect, there is no way for a user to determine that the display size is why Firefox is using the tablet user agent on their phone.

This impacts many more websites than just those hosted by Google, and it is unreasonable to expect the website to be able to determine the user is on a phone when the user agent is set to tablet.
There are a very small number people who have dug into the Android display settings and modified the display size setting. Setting it to small forces Firefox into the Tablet interface. Since Firefox is in the tablet interface the Tablet UA is used. I suggest users that want a mobile user agent can set general.useragent.override in about:config to a current Firefox for Android user agent. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox#Android_(version_41_and_above) for an example Firefox for Android phone user agent.
(In reply to Kevin Brosnan [:kbrosnan] from comment #6)
> There are a very small number people who have dug into the Android display
> settings and modified the display size setting.

Why does that make this not a bug? Stating that it does happen often doesn't
make the implementation correct.

> I suggest users that want a mobile user agent can set
> general.useragent.override in about:config to a current Firefox for Android
> user agent.

This is a partial workaround for the bug. It fixes the user agent. However,
it does not fix the issue with the tablet user interface being displayed.

Please reopen this bug.
Flags: needinfo?(michael.l.comella)
This issue is about the user agent, I don't agree with [:kbrosnan] about it and thinks the workaround is cumbersome (setting the user agent is difficult on mobile, also need to manually update the version after each upgrade).

That said, what interface firefox chooses to display itself is a totally separate issue. I don't have an opinion on that (actually I slightly prefer the tablet interface even on my phone).
I confirmed the behavior: setting Display Size to Small in Android settings will provide the tablet interface and desktop versions of sites (for the reason Kevin describes).

We're setting the tablet interface based on the resource size (large+ is tablet) [1] and the display size setting overrides the  conventions about physical screen size. We can't identify, "User is on phone with small display size" so we're forced to provide the tablet user interface and tablet user agent. We could provide an override for user agent, but this really only affects users who are in niche situations (changing the display size is under advanced settings) and is probably not worth 1) the code complexity to choose a different user agent and 2) cluttering up our settings, some of which may get changed by novice users accidentally, putting their browser into an unsatisfactory state.

Another workaround would be **to install a user agent switcher add-on, which you can set to a mobile Firefox device**. I think this workaround is pretty straightforward and adding a setting could be detrimental to existing users so I'm going to call this wontfix in favor of installing such an add-on.

[1]: https://searchfox.org/mozilla-central/search?q=path%3Amobile%2Fandroid**bool+is_large_resource&case=false&regexp=false&path=
Flags: needinfo?(michael.l.comella)
Resolution: INVALID → WONTFIX
1450928 :kbrosnan
Not a duplicate it's a completely different issue, I changed the description to be more clear.
Please reopen.
(In reply to Adham Magdy from comment #13)
> 1450928 :kbrosnan
> Not a duplicate it's a completely different issue, I changed the description
> to be more clear.
> Please reopen.

Sorry that's 1313522 Firefox App UI messed up in split screen view
https://bugzilla.mozilla.org/show_bug.cgi?id=1447737
1447737

That's the original bug.. not at all related to tablet mode or user agent, the app itself is messed up and forward and back buttons are duplicated and no address bar as in the screenshot attached to the bug..
also this Bugzilla is too complicated for me. I just wanted to report a bug...
My submitted bug just got duped to here - wondering if this implies that there is a defect in Focus because it doesn't do what Fennec does - or is Fennec supposed to be a special snowflake here. 

Also, Fenix doesn't do this, should bugs be opened?
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.