Module Brr.Window
Window objects.
Some of the objects and methods that are accessed from Window objects are in other modules:
type t = Brr.El.windowval as_target : Brr.Window.t -> Brr.Ev.targetas_target w is the window as an event target.
val closed : Brr.Window.t -> boolclosed w is true if w is closed.
val scroll_x : Brr.Window.t -> floatscroll_x w is the number of (sub)pixels the window is horizontally scrolled by.
val scroll_y : Brr.Window.t -> floatscroll_y w is the number of (sub)pixels the window is vertically scrolled by.
Media properties
val device_pixel_ratio : Brr.Window.t -> floatdevice_pixel_ratio w is the ratio between physical and CSS pixels. A value of 2. indicates that two physical pixels are used to draw a single CSS pixel.
val matches_media : Brr.Window.t -> Jstr.t -> boolmatches_media w mq is true if the media query mq matches. See Window.matchMedia.
val prefers_dark_color_scheme : Brr.Window.t -> boolprefers_dark_scheme w is true if the "(prefers-color-scheme: dark)" media query matches.
Operations
val open' :
?features:Jstr.t ->
?name:Jstr.t ->
Brr.Window.t ->
Jstr.t ->
Brr.Window.t optionopen' w url ~name ~features loads the specified resource url into a new or existing browsing context with the specified name and window features. None is returned if the window could not be opened.
val close : Brr.Window.t -> unitclose w closes window w.
val print : Brr.Window.t -> unitprint w opens the print dialog to print the window document.
val reload : Brr.Window.t -> unitreload w reloads w (on its location property).
Location and history
val location : Brr.Window.t -> Brr.Uri.tlocation w is the window's location.
Note we do not bind the Location object, everything you need can be done with Uri, set_location, reload and possibly History.
val set_location : Brr.Window.t -> Brr.Uri.t -> unitset_location w l sets the window location to l.
module History : sig ... endBrowser history.
val history : Brr.Window.t -> Brr.Window.History.thistory w is the history of w.
val to_jv : Brr.Window.t -> Jv.jvval of_jv : Jv.jv -> Brr.Window.t