mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-26 20:26:53 +00:00
LibWeb: Implement navigator.clipboard.read
This commit is contained in:
parent
a4e9a27343
commit
912009f6b3
Notes:
github-actions[bot]
2025-05-02 21:47:14 +00:00
Author: https://github.com/trflynn89
Commit: 912009f6b3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4548
Reviewed-by: https://github.com/shannonbooth
5 changed files with 163 additions and 1 deletions
|
@ -15,6 +15,11 @@
|
|||
|
||||
namespace Web::Clipboard {
|
||||
|
||||
struct ClipboardUnsanitizedFormats {
|
||||
// FIXME: This should not actually be an Optional, but the IDL generator creates it as such.
|
||||
Optional<Vector<String>> unsanitized;
|
||||
};
|
||||
|
||||
class Clipboard final : public DOM::EventTarget {
|
||||
WEB_PLATFORM_OBJECT(Clipboard, DOM::EventTarget);
|
||||
GC_DECLARE_ALLOCATOR(Clipboard);
|
||||
|
@ -23,6 +28,7 @@ public:
|
|||
static WebIDL::ExceptionOr<GC::Ref<Clipboard>> construct_impl(JS::Realm&);
|
||||
virtual ~Clipboard() override;
|
||||
|
||||
GC::Ref<WebIDL::Promise> read(ClipboardUnsanitizedFormats formats = {});
|
||||
GC::Ref<WebIDL::Promise> read_text();
|
||||
|
||||
GC::Ref<WebIDL::Promise> write(GC::RootVector<GC::Root<ClipboardItem>>&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue