Closed Bug 787786 Opened 12 years ago Closed 11 years ago

Metro Firefox user agent (UA) string

Categories

(Firefox for Metro Graveyard :: General, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jimm, Assigned: jimm)

Details

(Whiteboard: metro-preview, completed-elm)

Attachments

(1 file)

Current UA string for metrofx:

Mozilla/5.0 (Windows NT 6.2; WOW64; rv:18.0) Gecko/18.8 Firefox/18.0 MetroFirefox/18.0a1

The 'MetroFirefox' comes from the current app name in use.

Before we do any pre-releases we need to be sure this is how we want the UA to be formatted.
Whiteboard: metro-preview
Wouldn't it make more sense to put "Metro" in the platform?

Mozilla/5.0 (Windows NT 6.2; Metro WOW64; rv:18.0) Gecko/18.0 Firefox/18.0

Also, would it make sense to (also) identify as a tablet if touch is available?
Honestly I don't know that much about UAs and how sites use them. cc'ing a few people who might.
Metro IE10 returns the same UA as the desktop counterpart. Do we need to return a different UA at all? We have continued to discourage UA-sniffing.
Metro Chrome also uses the same UA as desktop's one.
Oop - thanks for filing this Jim, let's get UA veterans on board.
The current MetroFox UA comes from an old Fennec XUL UA. At a minimum, we need to drop the "MetroFirefox/18.0a1" token completely. Using our normal desktop Windows UA seems like a good place to start.

Personally, I see no need to add any "Metro" identifier at all. It's questionable as to whether we should add a "Tablet" token too.
How do sites like google use this info? I've noticed that when viewing google results in metrofx, we get the ancient and ugly mobile results page instead of their tablet interface. Similar results show up on image search. If you flip down to the bottom of the page, you can switch to "classic", but there isn't a "tablet" option provided.

Do we need to identify as a tablet in some way so sites like google can return the right layout?
(In reply to Jim Mathies [:jimm] from comment #7)
> How do sites like google use this info? I've noticed that when viewing
> google results in metrofx, we get the ancient and ugly mobile results page
> instead of their tablet interface. Similar results show up on image search.
> If you flip down to the bottom of the page, you can switch to "classic", but
> there isn't a "tablet" option provided.
They use completely ad-hoc, inconsistent way (for example, see bug 651674).

> Do we need to identify as a tablet in some way so sites like google can
> return the right layout?
The version number would suffice. When they noticed a version of Firefox start to support Metro, they would update their sniffing code.

We should really reduce the UA-sniffing, rather than increasing. If we really really need to be identified by some broken sites, we should use site-specific User Agent infrastructure introduced in bug 782453, instead of globally adding "Metro", "Tablet", or whatever. IE10 has a similar infrastructure (search for "uaStringMetro" in <http://iecvlist.microsoft.com/ie10/201206/iecompatviewlist.xml>).
Site-specific UA stuff is coming, although it needs to be used sparingly.

I think we should follow Chrome's lead and have the Metro Firefox UA, by default, be the same as the desktop one. If the device has a touchscreen we might want to add a "Tablet" token (or "Touch" - that debate still isn't entirely dead). But otherwise we should keep it the same.

MetroFirefox/18.0a1 certainly needs to go.

Mozilla/5.0 (Windows NT 6.2; WOW64; rv:18.0) Gecko/18.8 Firefox/18.0 

Gerv
FWIW, according to MDN we add tablet/mobile keys. Maybe these docs are out of date.

https://developer.mozilla.org/en-US/docs/Gecko_user_agent_string_reference

I'll update metrofx to use fxdesktop's ua string.
Attached patch ini patchSplinter Review
With this change:

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0
Assignee: nobody → jmathies
Attachment #661054 - Flags: review?(mark.finkle)
Note, I ran that on a Win7 desktop, the win version wouldn't normally be 6.2.
Comment on attachment 661054 [details] [diff] [review]
ini patch

You should also remove the pref for compatMode here:
http://mxr.mozilla.org/projects-central/source/elm/browser/metro/profile/metro.js#68

FWIW, here is the diff when Fennec changed UA. We just did the UA_NAME part in confvars instead of application.ini

Looks good.
Attachment #661054 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/projects/elm/rev/5c6e87fa3fcf
Whiteboard: metro-preview → metro-preview, completed-elm
(In reply to Mark Finkle (:mfinkle) from comment #13)
> Comment on attachment 661054 [details] [diff] [review]
> ini patch
> 
> You should also remove the pref for compatMode here:
> http://mxr.mozilla.org/projects-central/source/elm/browser/metro/profile/
> metro.js#68
> 
> FWIW, here is the diff when Fennec changed UA. We just did the UA_NAME part
> in confvars instead of application.ini

I looked at MOZ_APP_UA_NAME. Desktop fx doesn't define this and prefers to pull from app ini. At one point we were doing ua strings based on branded version name ('Nightly'), but we aren't anymore. So I matched that behavior using the UAName ini entry. Nice we had that actually, because we inherit desktop confvars and we also want a unique app name for profiles.
It appears that I was CCed for opinion, so here's mine:
We shouldn't be encouraging UA sniffing, so when running under the UI mode formerly known as Metro on a desktop or laptop computer, we should send the same UA string as in the desktop UI mode. If it is possible to detect that Firefox is running on a Windows tablet, I think it would make sense to add the Tablet token in the UI mode formerly known as Metro in that case in order to honor the promise of the Tablet token as a platform-independent indication of tabletness. (FWIW, I think Microsoft's quest to promote touchscreen on desktops and laptops will fail due to ergonomic issues, so I think we shouldn't bother with their "Touch" token.) If a specific site breaks when behaving as recounted in the last two sentences, I think we should send a site-specific UA string if it is a top site.
FWIW, the 'Touch' token was already shot down for fennec in bug 773355. If anyone feels strongly about adding 'Tablet', please file a follow up bug, and remember to mark the os as "Windows 8 Metro".
Product: Firefox → Firefox for Metro
Depends on: 809396
No longer depends on: 809396
Resolving bugs in the Firefox for Metro product that are fixed on the elm branch.  Sorry for the bugspam.  Search your email for "bugspam-elm" if you want to find and delete all of these messages at once.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Summary: MetroFirefox UA string → Metro Firefox user agent (UA) string
OS: Windows 8 Metro → Windows 8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: