script/dom/
navigatorinfo.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5use crate::dom::bindings::str::DOMString;
6
7#[allow(non_snake_case)]
8pub(crate) fn Product() -> DOMString {
9    DOMString::from("Gecko")
10}
11
12#[allow(non_snake_case)]
13pub(crate) fn ProductSub() -> DOMString {
14    DOMString::from("20100101")
15}
16
17#[allow(non_snake_case)]
18pub(crate) fn Vendor() -> DOMString {
19    DOMString::from("")
20}
21
22#[allow(non_snake_case)]
23pub(crate) fn VendorSub() -> DOMString {
24    DOMString::from("")
25}
26
27#[allow(non_snake_case)]
28pub(crate) fn TaintEnabled() -> bool {
29    false
30}
31
32#[allow(non_snake_case)]
33pub(crate) fn AppName() -> DOMString {
34    DOMString::from("Netscape") // Like Gecko/Webkit
35}
36
37#[allow(non_snake_case)]
38pub(crate) fn AppCodeName() -> DOMString {
39    DOMString::from("Mozilla")
40}
41
42#[allow(non_snake_case)]
43#[cfg(target_os = "windows")]
44pub(crate) fn Platform() -> DOMString {
45    DOMString::from("Win32")
46}
47
48#[allow(non_snake_case)]
49#[cfg(any(target_os = "android", target_os = "linux"))]
50pub(crate) fn Platform() -> DOMString {
51    DOMString::from("Linux")
52}
53
54#[allow(non_snake_case)]
55#[cfg(target_os = "macos")]
56pub(crate) fn Platform() -> DOMString {
57    DOMString::from("Mac")
58}
59
60#[allow(non_snake_case)]
61#[cfg(target_os = "ios")]
62pub(crate) fn Platform() -> DOMString {
63    DOMString::from("iOS")
64}
65
66#[allow(non_snake_case)]
67pub(crate) fn UserAgent(user_agent: &str) -> DOMString {
68    DOMString::from(user_agent)
69}
70
71#[allow(non_snake_case)]
72pub(crate) fn AppVersion() -> DOMString {
73    DOMString::from("4.0")
74}
75
76#[allow(non_snake_case)]
77pub(crate) fn Language() -> DOMString {
78    DOMString::from("en-US")
79}