1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +00:00

LibWeb: Implement navigator.{plugins,mimeTypes}

This commit is contained in:
Luke Wilde 2023-02-28 00:23:53 +00:00 committed by Andreas Kling
parent 5e422bdae0
commit 4d0277cd9a
20 changed files with 767 additions and 4 deletions

View file

@ -7,10 +7,12 @@
#pragma once
#include <LibWeb/Bindings/PlatformObject.h>
#include <LibWeb/HTML/MimeTypeArray.h>
#include <LibWeb/HTML/NavigatorConcurrentHardware.h>
#include <LibWeb/HTML/NavigatorID.h>
#include <LibWeb/HTML/NavigatorLanguage.h>
#include <LibWeb/HTML/NavigatorOnLine.h>
#include <LibWeb/HTML/PluginArray.h>
namespace Web::HTML {
@ -35,17 +37,25 @@ public:
// https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-javaenabled
bool java_enabled() const { return false; }
// https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-pdfviewerenabled
bool pdf_viewer_enabled() const;
bool webdriver() const;
JS::ThrowCompletionOr<JS::NonnullGCPtr<MimeTypeArray>> mime_types();
JS::ThrowCompletionOr<JS::NonnullGCPtr<PluginArray>> plugins();
virtual ~Navigator() override;
protected:
virtual void visit_edges(Cell::Visitor&) override;
private:
explicit Navigator(JS::Realm&);
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
JS::GCPtr<PluginArray> m_plugin_array;
JS::GCPtr<MimeTypeArray> m_mime_type_array;
};
}