servo/components/script/dom/navigatorinfo.rs
Martin Robinson 4402b7cf8f
libservo: Remove a couple EmbedderMethods (#36276)
- Remove `EmbedderMethods::get_user_agent_string`. This is now part of
  the `Preferences` data structure, which should allow it to be
  per-`WebView` in the future.
- Remove `EmbedderMethods::get_version_string`. This was used to include
  some data along with WebRender captures about the Servo version. This
  isn't really necessary and it was done to replace code in the past
  that output the WebRender version, so also isn't what the original
  code did. I think we can just remove this entirely.

The idea with these changes is that `EmbedderMethods` can be removed
in a followup and the rest of the methods can be added to
`ServoDelegate`. These two methods are ones that cannot be added to a
delegate as they are used during `Servo` initialization.

Testing: There is currently no testing for libservo. These changes are
meant
as preparation for adding a suite of `WebView` unit tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-04-01 22:59:50 +00:00

79 lines
1.7 KiB
Rust

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::str::DOMString;
#[allow(non_snake_case)]
pub(crate) fn Product() -> DOMString {
DOMString::from("Gecko")
}
#[allow(non_snake_case)]
pub(crate) fn ProductSub() -> DOMString {
DOMString::from("20100101")
}
#[allow(non_snake_case)]
pub(crate) fn Vendor() -> DOMString {
DOMString::from("")
}
#[allow(non_snake_case)]
pub(crate) fn VendorSub() -> DOMString {
DOMString::from("")
}
#[allow(non_snake_case)]
pub(crate) fn TaintEnabled() -> bool {
false
}
#[allow(non_snake_case)]
pub(crate) fn AppName() -> DOMString {
DOMString::from("Netscape") // Like Gecko/Webkit
}
#[allow(non_snake_case)]
pub(crate) fn AppCodeName() -> DOMString {
DOMString::from("Mozilla")
}
#[allow(non_snake_case)]
#[cfg(target_os = "windows")]
pub(crate) fn Platform() -> DOMString {
DOMString::from("Win32")
}
#[allow(non_snake_case)]
#[cfg(any(target_os = "android", target_os = "linux"))]
pub(crate) fn Platform() -> DOMString {
DOMString::from("Linux")
}
#[allow(non_snake_case)]
#[cfg(target_os = "macos")]
pub(crate) fn Platform() -> DOMString {
DOMString::from("Mac")
}
#[allow(non_snake_case)]
#[cfg(target_os = "ios")]
pub(crate) fn Platform() -> DOMString {
DOMString::from("iOS")
}
#[allow(non_snake_case)]
pub(crate) fn UserAgent(user_agent: &str) -> DOMString {
DOMString::from(user_agent)
}
#[allow(non_snake_case)]
pub(crate) fn AppVersion() -> DOMString {
DOMString::from("4.0")
}
#[allow(non_snake_case)]
pub(crate) fn Language() -> DOMString {
DOMString::from("en-US")
}