mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:57:45 +00:00
LibWeb: Add an Internals API to trigger a user-activated (trusted) event
Some DOM APIs are restricted to user-activated events. For example, you can't just invoke `navigator.clipboard.writeText` from JS - it has to be accompanied by a user gesture, such as a mouse-down event. This adds an Internals API to simulate such a gesture.
This commit is contained in:
parent
6761791c9a
commit
78d455e231
3 changed files with 13 additions and 0 deletions
|
@ -21,6 +21,8 @@ public:
|
|||
void gc();
|
||||
JS::Object* hit_test(double x, double y);
|
||||
|
||||
WebIDL::ExceptionOr<bool> dispatch_user_activated_event(DOM::EventTarget&, DOM::Event& event);
|
||||
|
||||
private:
|
||||
explicit Internals(JS::Realm&);
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue