class dom::Win

sys::Obj
  dom::Win

@Js

Source

Win models the DOM window object.

See pod doc for details.

alert

Void alert(Obj obj)

Source

Display a modal message box with the given text.

close

Win close()

Source

Close this window. Only applicable to windows created with open. Otherwise method has no effect. Returns this.

cur

const static Win cur()

Source

Return the current window instance.

doc

Doc doc()

Source

Return the Doc instance for this window.

hisBack

Void hisBack()

Source

Go to previous page in session history.

hisForward

Void hisForward()

Source

Go to next page in the session history.

hisPushState

Void hisPushState(Str title, Uri uri, Str:Obj map)

Source

Push a new history item onto the history stack. Use onpopstate to listen for changes:

// Event.meta contains state map passed into pushState
Win.cur.onEvent("popstate", false) |e| { echo("# state: $e.meta") }

Void hyperlink(Uri uri)

Source

Hyperlink to the given Uri in this window.

localStorage

Storage localStorage()

Source

Return local storage instance for window.

onEvent

Void onEvent(Str type, Bool useCapture, |DomEvent| handler)

Source

Attach an event handler to the given event on this element.

open

const static Win open(Uri uri := `about:blank`, Str? winName := null, [Str:Str]? opts := null)

Source

Open a new window. Returns the new window instance.

reload

Void reload(Bool force := false)

Source

Reload the current page. Use force to bypass browse cache.

sessionStorage

Storage sessionStorage()

Source

Return session storage instance for window.

uri

Uri uri()

Source

Get the Uri for this window.

viewport

Size viewport()

Source

Return the size of the window viewport in pixels.