Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow embedders to provide user agent string #25672

Closed
wants to merge 8 commits into from
Prev

Update user agent strings to those from #25669

  • Loading branch information
mediremi committed Feb 1, 2020
commit 4405d3a03f1ef3f85c0be0a7601865b962e6d515
@@ -187,29 +187,29 @@ pub trait EmbedderMethods {
fn default_user_agent_string(&self) -> &'static str {
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
const UA_STRING: &'static str =
"Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Servo/1.0 Firefox/63.0";
"Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Servo/1.0 Firefox/72.0";
#[cfg(all(target_os = "linux", not(target_arch = "x86_64")))]
const UA_STRING: &'static str =
"Mozilla/5.0 (X11; Linux i686; rv:63.0) Servo/1.0 Firefox/63.0";
"Mozilla/5.0 (X11; Linux i686; rv:72.0) Servo/1.0 Firefox/72.0";

#[cfg(all(target_os = "windows", target_arch = "x86_64"))]
const UA_STRING: &'static str =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Servo/1.0 Firefox/63.0";
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Servo/1.0 Firefox/72.0";
#[cfg(all(target_os = "windows", not(target_arch = "x86_64")))]
const UA_STRING: &'static str =
"Mozilla/5.0 (Windows NT 10.0; rv:63.0) Servo/1.0 Firefox/63.0";
"Mozilla/5.0 (Windows NT 10.0; rv:72.0) Servo/1.0 Firefox/72.0";

#[cfg(all(target_os = "macos"))]

This comment has been minimized.

@paulrouget

paulrouget Feb 7, 2020

Contributor

I don’t think the all is necessary here.

const UA_STRING: &'static str =
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:63.0) Servo/1.0 Firefox/63.0";
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Servo/1.0 Firefox/72.0";

#[cfg(target_os = "android")]
const UA_STRING: &'static str =
"Mozilla/5.0 (Android; Mobile; rv:63.0) Servo/1.0 Firefox/63.0";
"Mozilla/5.0 (Android; Mobile; rv:68.0) Servo/1.0 Firefox/68.0";

#[cfg(target_os = "ios")]
const UA_STRING: &'static str =
"Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X; rv:63.0) Servo/1.0 Firefox/63.0";
"Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X; rv:72.0) Servo/1.0 Firefox/72.0";

#[cfg(not(any(
target_os = "linux",
@@ -220,7 +220,7 @@ pub trait EmbedderMethods {
)))]
// Use OS X user agent as fallback
const UA_STRING: &'static str =
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:63.0) Servo/1.0 Firefox/63.0";
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Servo/1.0 Firefox/72.0";

This comment has been minimized.

@paulrouget

paulrouget Feb 7, 2020

Contributor

That’s fine because it’s what we’ve been doing until now. But maybe we should just not have a fallback. Once we support a new platform, we would let it fail at compile time.


UA_STRING
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.