Rewild Your Web
web
browser
dweb
1--- original
2+++ modified
3@@ -0,0 +1,37 @@
4+/* SPDX Id: AGPL-3.0-or-later */
5+
6+// Servo-specific API for virtual keyboard input injection.
7+// This allows privileged pages (system.localhost, settings.localhost) to
8+// inject keyboard/composition events into webviews that have active IME input.
9+
10+dictionary ServoKeyboardEventInit {
11+ required DOMString state; // "down" or "up"
12+ required DOMString key; // Key character or named key
13+ DOMString code = ""; // Physical key code
14+ unsigned long location = 0; // KeyboardEvent.location value
15+ boolean shift = false;
16+ boolean ctrl = false;
17+ boolean alt = false;
18+ boolean meta = false;
19+ boolean repeat = false;
20+ boolean isComposing = false;
21+};
22+
23+dictionary ServoCompositionEventInit {
24+ required DOMString state; // "start", "update", or "end"
25+ DOMString data = ""; // The composition text
26+};
27+
28+[Exposed=Window, Func="Embedder::is_allowed_to_embed"]
29+interface Keyboard {
30+ // Send a keyboard event (keydown/keyup) to the active IME input.
31+ [Throws] undefined sendKeyboardEvent(ServoKeyboardEventInit event);
32+
33+ // Send a composition event to the active IME input.
34+ [Throws] undefined sendCompositionEvent(ServoCompositionEventInit event);
35+};
36+
37+partial interface Navigator {
38+ [Func="Embedder::is_allowed_to_embed"]
39+ readonly attribute Keyboard keyboard;
40+};