Module Make.Window

Windows and tabs management.

type t

A handle to a browser window (or a tab)

type hint = [
| `tab
| `window
]
val make : hint -> (t * [ hint | `other of json ]) cmd

Create a new window or tab, using hint as a suggestion. Returns a handle to the created window/tab and its actual kind.

val current : t cmd

The current browser window/tab.

val switch_to : t -> unit cmd

switch_to w sets the current window to w.

val close : t list cmd

close ws closes a list of windows.

val all : t list cmd

List of all the opened browser windows/tabs.

type rect = {
x : int;
y : int;
width : int;
height : int;
}
val get_rect : rect cmd

The size and position of the current window.

val set_rect : rect -> rect cmd

set_rect r attempts to resize the current window to match the rectangle r.

val maximize : rect cmd

Maximizes the current window.

val minimize : rect cmd

Minimizes the current window.

val fullscreen : rect cmd

Fullscreen the current window.