NavigatorID.h 2.1 KB

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