Serenity Operating System
1/*
2 * Copyright (c) 2022, Andrew Kaster <akaster@serenityos.org>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#include <AK/DeprecatedString.h>
10
11namespace Web::HTML {
12
13class NavigatorIDMixin {
14public:
15 // WARNING: Any information in this API that varies from user to user can be used to profile the user. In fact, if
16 // enough such information is available, a user can actually be uniquely identified. For this reason, user agent
17 // implementers are strongly urged to include as little information in this API as possible.
18
19 // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-appcodename
20 DeprecatedString app_code_name() const { return "Mozilla"sv; }
21
22 // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-appcodename
23 DeprecatedString app_name() const { return "Netscape"sv; }
24
25 // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-appversion
26 DeprecatedString app_version() const;
27
28 // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-platform
29 DeprecatedString platform() const;
30
31 // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-product
32 DeprecatedString product() const { return "Gecko"sv; }
33
34 // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-productsub
35 DeprecatedString product_sub() const { return "20030107"sv; } // Compatibility mode "Chrome"
36
37 // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-useragent
38 DeprecatedString user_agent() const;
39
40 // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-vendor
41 DeprecatedString vendor() const { return "Google Inc."sv; } // Compatibility mode "Chrome"
42
43 // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-vendorsub
44 DeprecatedString vendor_sub() const { return ""sv; }
45
46 // NOTE: If the navigator compatibility mode is Gecko, then the user agent must also support the following partial interface:
47 // bool taint_enabled()
48 // DeprecatedString oscpu()
49};
50
51}