@@ -136,14 +136,6 @@ pub const Window = struct {
136136 self .onload_callback = null ;
137137 }
138138
139- pub fn get_window (self : * Window ) * Window {
140- return self ;
141- }
142-
143- pub fn get_navigator (self : * Window ) * Navigator {
144- return & self .navigator ;
145- }
146-
147139 pub fn get_location (self : * Window ) * Location {
148140 return & self .location ;
149141 }
@@ -152,22 +144,6 @@ pub const Window = struct {
152144 return page .navigateFromWebAPI (url , .{ .reason = .script });
153145 }
154146
155- pub fn get_console (self : * Window ) * Console {
156- return & self .console ;
157- }
158-
159- pub fn get_crypto (self : * Window ) * Crypto {
160- return & self .crypto ;
161- }
162-
163- pub fn get_self (self : * Window ) * Window {
164- return self ;
165- }
166-
167- pub fn get_parent (self : * Window ) * Window {
168- return self ;
169- }
170-
171147 // frames return the window itself, but accessing it via a pseudo
172148 // array returns the Window object corresponding to the given frame or
173149 // iframe.
@@ -205,10 +181,6 @@ pub const Window = struct {
205181 return frames .get_length ();
206182 }
207183
208- pub fn get_top (self : * Window ) * Window {
209- return self ;
210- }
211-
212184 pub fn get_document (self : * Window ) ? * parser.DocumentHTML {
213185 return self .document ;
214186 }
@@ -243,14 +215,6 @@ pub const Window = struct {
243215 return & self .storage_shelf .? .bucket .session ;
244216 }
245217
246- pub fn get_performance (self : * Window ) * Performance {
247- return & self .performance ;
248- }
249-
250- pub fn get_screen (self : * Window ) * Screen {
251- return & self .screen ;
252- }
253-
254218 pub fn get_CSS (self : * Window ) * Css {
255219 return & self .css ;
256220 }
@@ -463,6 +427,18 @@ pub const Window = struct {
463427 // and thus the target has already been set to the document.
464428 return self .base .redispatchEvent (evt );
465429 }
430+
431+ pub fn postAttach (self : * Window , js_this : js.This ) ! void {
432+ try js_this .set ("top" , self , .{});
433+ try js_this .set ("self" , self , .{});
434+ try js_this .set ("parent" , self , .{});
435+ try js_this .set ("window" , self , .{});
436+ try js_this .set ("crypto" , & self .crypto , .{});
437+ try js_this .set ("screen" , & self .screen , .{});
438+ try js_this .set ("console" , & self .console , .{});
439+ try js_this .set ("navigator" , & self .navigator , .{});
440+ try js_this .set ("performance" , & self .performance , .{});
441+ }
466442};
467443
468444const TimerCallback = struct {
0 commit comments