NavigatorID.h 1.9 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/String.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. String app_code_name() const { return "Mozilla"_string; }
  16. // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-appcodename
  17. String app_name() const { return "Netscape"_string; }
  18. // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-appversion
  19. String app_version() const;
  20. // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-platform
  21. String platform() const;
  22. // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-product
  23. String product() const { return "Gecko"_string; }
  24. // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-productsub
  25. String product_sub() const;
  26. // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-useragent
  27. String user_agent() const;
  28. // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-vendor
  29. String vendor() const;
  30. // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-vendorsub
  31. String vendor_sub() const { return String {}; }
  32. // FIXME: If the navigator compatibility mode is Gecko, then the user agent must also support the following partial interface:
  33. // bool taint_enabled()
  34. // ByteString oscpu()
  35. };
  36. }