Rewild Your Web
web browser dweb
at main 40 lines 1.4 kB view raw
1--- original 2+++ modified 3@@ -0,0 +1,37 @@ 4+/* SPDX Id: AGPL-3.0-or-later */ 5+ 6+// Servo-specific API for communication between web content and the embedder. 7+ 8+[Exposed=Window, 9+Func="Embedder::is_allowed_to_embed"] 10+interface Embedder : EventTarget { 11+ // Request the embedder to open a new OS-level window with the given URL. 12+ undefined openNewOSWindow(USVString url, optional USVString features = ""); 13+ 14+ // Request the embedder to close the currently focused OS window. 15+ undefined closeCurrentOSWindow(); 16+ 17+ // Request the embedder to exit the application. 18+ undefined exit(); 19+ 20+ // Request the embedder to start a window drag operation. 21+ // This allows the window to be moved by dragging from web content. 22+ undefined startWindowDrag(); 23+ 24+ // Request the embedder to start a window resize operation. 25+ // This allows the window to be resized from web content. 26+ undefined startWindowResize(); 27+ 28+ // Event fired when Servo encounters an error. 29+ // The event is a CustomEvent with detail: { errorType: string, message: string } 30+ attribute EventHandler onservoerror; 31+ 32+ // Event fired when a preference changes. 33+ // The event is a CustomEvent with detail: { name: string, value: any } 34+ attribute EventHandler onpreferencechanged; 35+}; 36+ 37+partial interface Navigator { 38+ [Func="Embedder::is_allowed_to_embed"] 39+ readonly attribute Embedder embedder; 40+};