From MozillaWiki
Jump to: navigation, search

User Agent Override

User Agent strings is a mechanism which gives information about the software and sometimes the device being used for accessing a Web site. Some Web sites customize the user experience based on this string. Sometimes this customization goes to the point where users are excluded because of this string. The override has been created for overcoming this issue by lying to the server about its own identity.

A bit of history

  • Opera had UA override for a long time through their BrowserJS mechanism, a server side feature helping to fix the Web (both JS, CSS and UA). Their policy evolved from Contact first then add UA override, to make it work and then contact.
  • Mozilla added UA override for B2G (Firefox OS) initially on the client side only (Firefox 1.0, Firefox 1.1), then on the server side with Firefox 1.2+. A similar mechanism has since been provided to Firefox Android (see Bug 1162099)

Removing UA override

In the spring of 2013 a projectet started at Mozilla on Mobile Web Compatibility Team for wiping out the UA override mechanism in B2G aka Firefox OS.

You can help!

Adding UA override

We do not recommend to add new UA override. We need to be very careful doing so and each site needs to have a strong case before doing so. We created a full policy for adding UA override.

Some technical recommendations

Responsive Design, Feature Detections

Mozilla recommends the use of responsive design and feature detection over UA detection. The request to augment a site to use these methods is much greater than the request to modify the existing site UA detection logic. This makes requesting the recognition of the B2G UA the lowest bar to 'fixing' these sites.

Device ID in UA string

The Firefox OS (B2G) project has specific guidelines if an operator is pushing on including the device id in the user agent string. We do not recommend it.