Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for Linux-specific UA string #7158
Comments
|
Is the distro name really needed? My Firefoxes, respectively Release from archlinux.org/packages and Nightly from mozilla.org, currently have:
I wouldn’t be surprised if |
|
@SimonSapin That seems consistent with https://wiki.mozilla.org/Firefox/User_Agent, though there isn't a ton of info I can find there or in other bugs on BMO. According to the source (http://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsHttpHandler.cpp#695), the |
|
https://bazaar.launchpad.net/~mozillateam/firefox/firefox.wily/view/head:/debian/patches/ubuntu-ua-string-changes.patch is an Ubuntu-specific patch adding the |
|
Yes, don't include the "Ubuntu" bit. Copy what stock Firefox does, which is "X11; Linux x86_64" or some related string for 32-bit if you guys support that. |
|
Marking this as |
|
See |
This implements servo#7158 by conditionally choosing a UA string by `#[cfg()]`-checking for `target_os = linux` and whether `target_arch` is `x86_64` or not. Matching the behavior of Firefox, either "X11; Linux x86_64" or "X11; Linux i686" is included. `target_os = windows` is also checked; again as in Firefox "Windows NT 6.1; Win64; x64" or just "Windows NT 6.1" is included. The UA string pretends to be non-WoW64 Windows 7, since there's only so much we can detect at build time. The existing desktop UA string that lists OS X is chosen if `target_os` is neither `linux` nor `windows`.
Make desktop UA string depend on build target. This implements #7158 by conditionally choosing a UA string by `#[cfg()]`-checking for `target_os = linux` and whether `target_arch` is `x86_64` or not. Matching the behavior of Firefox, either "X11; Linux x86_64" or "X11; Linux i686" is included. `target_os = windows` is also checked; again as in Firefox "Windows NT 6.1; Win64; x64" or just "Windows NT 6.1" is included. The UA string pretends to be non-WoW64 Windows 7, since there's only so much we can detect at build time. The existing desktop UA string that lists OS X is chosen if `target_os` is neither `linux` nor `windows`. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8353) <!-- Reviewable:end -->
|
Fixed by #8353. |
In #7143, we added a User Agent string for Servo, but only for Android, Gonk, and OSX. We would like to add a platform-specific Linux modifier.
Based on information from @gerv in #7143 (comment), we will need to include the full set of bits such as
X11; Ubuntu; Linux x86_64, which will require some analysis of the environment at startup. These additional bits (distro name) appear to be used for sites that want to be able to suggest the correct download.CC: @SimonSapin