Navigator.cpp 586 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) 2022, Andrew Kaster <akaster@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibJS/Heap/Heap.h>
  7. #include <LibJS/Runtime/Realm.h>
  8. #include <LibWeb/Bindings/Intrinsics.h>
  9. #include <LibWeb/HTML/Navigator.h>
  10. namespace Web::HTML {
  11. JS::NonnullGCPtr<Navigator> Navigator::create(JS::Realm& realm)
  12. {
  13. return *realm.heap().allocate<Navigator>(realm, realm);
  14. }
  15. Navigator::Navigator(JS::Realm& realm)
  16. : PlatformObject(realm)
  17. {
  18. set_prototype(&Bindings::cached_web_prototype(realm, "Navigator"));
  19. }
  20. Navigator::~Navigator() = default;
  21. }