org.scalajs.dom.raw

Window

Related Doc: package raw

class Window extends EventTarget with WindowLocalStorage with WindowSessionStorage with WindowTimers with WindowBase64 with IDBEnvironment with WindowConsole

The window object represents the window itself. The document property of a window points to the DOM document loaded in that window. A window for a given document can be obtained using the document.defaultView property.

In a tabbed browser, such as Firefox, each tab contains its own window object (and if you're writing an extension, the browser window itself is a separate window too - see Working with windows in chrome code for more information). That is, the window object is not shared between tabs in the same window. Some methods, namely window.resizeTo and window.resizeBy apply to the whole window and not to the specific tab the window object belongs to. Generally, anything that can't reasonably pertain to a tab pertains to the window instead.

MDN

Annotations
@RawJSType()
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Window
  2. WindowConsole
  3. IDBEnvironment
  4. WindowBase64
  5. WindowTimers
  6. WindowTimersExtension
  7. WindowSessionStorage
  8. WindowLocalStorage
  9. EventTarget
  10. Object
  11. Any
  12. AnyRef
  13. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Window()

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. def addEventListener[T <: Event](type: String, listener: Function1[T, _], useCapture: Boolean = js.native): Unit

    The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on.

    The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).

    MDN

    Definition Classes
    EventTarget
  5. def alert(): Unit

    The Window.alert() method displays an alert dialog with the optional specified content and an OK button.

    The Window.alert() method displays an alert dialog with the optional specified content and an OK button.

    MDN

  6. def alert(message: String): Unit

  7. def applicationCache: ApplicationCache

    An OfflineResourceList object providing access to the offline resources for the window.

    An OfflineResourceList object providing access to the offline resources for the window.

    MDN

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def atob(encodedString: String): String

    Decodes a string of data which has been encoded using base-64 encoding.

    Decodes a string of data which has been encoded using base-64 encoding.

    Definition Classes
    WindowBase64
  10. def blur(): Unit

    The window.blur() method is the programmatic equivalent of the user shifting focus away from the current window.

    The window.blur() method is the programmatic equivalent of the user shifting focus away from the current window.

    MDN

  11. def btoa(rawString: String): String

    Creates a base-64 encoded ASCII string from a "string" of binary data.

    Creates a base-64 encoded ASCII string from a "string" of binary data.

    Definition Classes
    WindowBase64
  12. def cancelAnimationFrame(handle: Int): Unit

    Cancels an animation frame request previously scheduled through a call to window.requestAnimationFrame().

    Cancels an animation frame request previously scheduled through a call to window.requestAnimationFrame().

    MDN

  13. def clearImmediate(handle: Int): Unit

    Definition Classes
    WindowTimersExtension
  14. def clearInterval(handle: Int): Unit

    Cancels repeated action which was set up using setInterval.

    Cancels repeated action which was set up using setInterval.

    MDN

    Definition Classes
    WindowTimers
  15. def clearTimeout(handle: Int): Unit

    Clears the delay set by window.setTimeout().

    Clears the delay set by window.setTimeout().

    MDN

    Definition Classes
    WindowTimers
  16. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. def close(): Unit

    Closes the current window, or a referenced window.

    Closes the current window, or a referenced window.

    MDN

  18. def confirm(message: String = js.native): Boolean

    The Window.confirm() method displays a modal dialog with an optional message and two buttons, OK and Cancel.

    The Window.confirm() method displays a modal dialog with an optional message and two buttons, OK and Cancel.

    MDN

  19. var console: Console

    Definition Classes
    WindowConsole
  20. def dispatchEvent(evt: Event): Boolean

    Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order.

    Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) apply to events dispatched manually with dispatchEvent().

    MDN

    Definition Classes
    EventTarget
  21. def document: HTMLDocument

    Returns a reference to the document that the window contains.

    Returns a reference to the document that the window contains.

    MDN

  22. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  24. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. def focus(): Unit

    Makes a request to bring the window to the front.

    Makes a request to bring the window to the front. It may fail due to user settings and the window isn't guaranteed to be frontmost before this method returns.

    MDN

  26. def frameElement: Element

    Returns the element (such as <iframe> or ) in which the window is embedded, or null if the window is top-level. MDN

    Returns the element (such as <iframe> or ) in which the window is embedded, or null if the window is top-level. MDN

  27. def frames: Window

    Returns the window itself, which is an array-like object, listing the direct sub-frames of the current window.

    Returns the window itself, which is an array-like object, listing the direct sub-frames of the current window.

    MDN

  28. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  29. def getComputedStyle(elt: Element, pseudoElt: String = js.native): CSSStyleDeclaration

  30. def getSelection(): Selection

    Returns a selection object representing the range of text selected by the user.

    Returns a selection object representing the range of text selected by the user.

    MDN

  31. def hasOwnProperty(v: String): Boolean

    Definition Classes
    Object
  32. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  33. def history: History

    The Window.history read-only property returns a reference to the History object, which provides an interface for manipulating the browser session history (pages visited in the tab or frame that the current page is loaded in).

    The Window.history read-only property returns a reference to the History object, which provides an interface for manipulating the browser session history (pages visited in the tab or frame that the current page is loaded in).

    MDN

  34. def indexedDB: IDBFactory

    an IDBRequest object that communicates back to the requesting application through events.

    an IDBRequest object that communicates back to the requesting application through events. This design means that any number of requests can be active on any database at a time.

    MDN

    Definition Classes
    IDBEnvironment
  35. def innerHeight: Int

    Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.

    Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.

    MDN

  36. var innerWidth: Int

    Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.

    Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.

    MDN

  37. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  38. def isPrototypeOf(v: Object): Boolean

    Definition Classes
    Object
  39. def length: Int

    Returns the number of frames (either frame or iframe elements) in the window.

    Returns the number of frames (either frame or iframe elements) in the window.

    MDN

  40. def localStorage: Storage

    Definition Classes
    WindowLocalStorage
  41. var location: Location

    The Window.location property returns a Location object with information about the current location of the document.

    The Window.location property returns a Location object with information about the current location of the document.

    MDN

  42. def matchMedia(mediaQuery: String): MediaQueryList

    Returns a new MediaQueryList object representing the parsed results of the specified media query string.

    Returns a new MediaQueryList object representing the parsed results of the specified media query string.

    MDN

  43. var name: String

    The name of the window is used primarily for setting targets for hyperlinks and forms.

    The name of the window is used primarily for setting targets for hyperlinks and forms. Windows do not need to have names.

    MDN

  44. def navigator: Navigator

    The Window.navigator read-only property returns a reference to the Navigator object, which can be queried for information about the application running the script.

    The Window.navigator read-only property returns a reference to the Navigator object, which can be queried for information about the application running the script.

    MDN

  45. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  46. final def notify(): Unit

    Definition Classes
    AnyRef
  47. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  48. var onabort: Function1[UIEvent, _]

    An event handler property for abort events on the window.

    An event handler property for abort events on the window.

    MDN

  49. var onafterprint: Function1[Event, _]

    The onafterprint property sets and returns the onafterprint event handler code for the current window.

    The onafterprint property sets and returns the onafterprint event handler code for the current window.

    MDN

  50. var onbeforeprint: Function1[Event, _]

    The onbeforeprint property sets and returns the onbeforeprint event handler code for the current window.

    The onbeforeprint property sets and returns the onbeforeprint event handler code for the current window.

    MDN

  51. var onbeforeunload: Function1[BeforeUnloadEvent, _]

    An event that fires when a window is about to unload its resources.

    An event that fires when a window is about to unload its resources. The document is still visible and the event is still cancelable.

    MDN

  52. var onblur: Function1[FocusEvent, _]

    The onblur property can be used to set the blur handler on the window, which is triggered when the window loses focus.

    The onblur property can be used to set the blur handler on the window, which is triggered when the window loses focus.

    MDN

  53. var oncanplay: Function1[Event, _]

  54. var oncanplaythrough: Function1[Event, _]

  55. var onchange: Function1[Event, _]

    An event handler property for change events on the window.

    An event handler property for change events on the window.

    MDN

  56. var onclick: Function1[MouseEvent, _]

    Called when the user clicks the mouse button while the cursor is in the window.

    Called when the user clicks the mouse button while the cursor is in the window. This event is fired for any mouse button pressed; you can look at the event properties to find out which button was pressed and where.

    MDN

  57. var oncontextmenu: Function1[MouseEvent, _]

    An event handler property for right-click events on the window.

    An event handler property for right-click events on the window.

    MDN

  58. var ondblclick: Function1[MouseEvent, _]

  59. var ondrag: Function1[DragEvent, _]

  60. var ondragend: Function1[DragEvent, _]

  61. var ondragenter: Function1[DragEvent, _]

    Called for an element when the mouse pointer first moves over the element while something is being dragged.

    Called for an element when the mouse pointer first moves over the element while something is being dragged. This might be used to change the appearance of the element to indicate to the user that the object can be dropped on it.

    MDN

  62. var ondragleave: Function1[DragEvent, _]

  63. var ondragover: Function1[DragEvent, _]

  64. var ondragstart: Function1[DragEvent, _]

  65. var ondrop: Function1[DragEvent, _]

  66. var ondurationchange: Function1[Event, _]

  67. var onemptied: Function1[Event, _]

  68. var onended: Function1[Event, _]

  69. var onerror: Function4[Event, String, Int, Int, _]

    An event handler property for errors raised on the window.

    An event handler property for errors raised on the window.

    MDN

  70. var onfocus: Function1[FocusEvent, _]

    An event handler property for focus events on the window.

    An event handler property for focus events on the window.

    MDN

  71. var onhashchange: Function1[HashChangeEvent, _]

    An event handler property for hash change events on the window; called when the part of the URL after the hash mark ("#") changes.

    An event handler property for hash change events on the window; called when the part of the URL after the hash mark ("#") changes.

    MDN

  72. var oninput: Function1[Event, _]

  73. var onkeydown: Function1[KeyboardEvent, _]

    An event handler property for keydown events on the window.

    An event handler property for keydown events on the window.

    MDN

  74. var onkeypress: Function1[KeyboardEvent, _]

    An event handler property for keypress events on the window.

    An event handler property for keypress events on the window.

    MDN

  75. var onkeyup: Function1[KeyboardEvent, _]

    An event handler property for keyup events on the window.

    An event handler property for keyup events on the window.

    MDN

  76. var onload: Function1[Event, _]

    An event handler property for window loading.

    An event handler property for window loading.

    MDN

  77. var onloadeddata: Function1[Event, _]

  78. var onloadedmetadata: Function1[Event, _]

  79. var onloadstart: Function1[Event, _]

  80. var onmessage: Function1[MessageEvent, _]

  81. var onmousedown: Function1[MouseEvent, _]

    An event handler property for mousedown events on the window.

    An event handler property for mousedown events on the window.

    MDN

  82. var onmousemove: Function1[MouseEvent, _]

    An event handler property for mousemove events on the window.

    An event handler property for mousemove events on the window.

    MDN

  83. var onmouseout: Function1[MouseEvent, _]

    An event handler property for mouseout events on the window.

    An event handler property for mouseout events on the window.

    MDN

  84. var onmouseover: Function1[MouseEvent, _]

    An event handler property for mouseover events on the window.

    An event handler property for mouseover events on the window.

    MDN

  85. var onmouseup: Function1[MouseEvent, _]

    An event handler property for mouseup events on the window.

    An event handler property for mouseup events on the window.

    MDN

  86. var onmousewheel: Function1[WheelEvent, _]

  87. var onoffline: Function1[Event, _]

  88. var ononline: Function1[Event, _]

  89. var onpause: Function1[Event, _]

  90. var onplay: Function1[Event, _]

  91. var onplaying: Function1[Event, _]

  92. var onpopstate: Function1[PopStateEvent, _]

    An event handler property for popstate events, which are fired when navigating to a session history entry representing a state object.

    An event handler property for popstate events, which are fired when navigating to a session history entry representing a state object.

    MDN

  93. var onprogress: Function1[Any, _]

  94. var onratechange: Function1[Event, _]

  95. var onreadystatechange: Function1[Event, _]

  96. var onreset: Function1[Event, _]

    An event handler property for reset events on the window.

    An event handler property for reset events on the window.

    MDN

  97. var onresize: Function1[UIEvent, _]

    An event handler for the resize event on the window.

    An event handler for the resize event on the window.

    MDN

  98. var onscroll: Function1[UIEvent, _]

    Specifies the function to be called when the window is scrolled.

    Specifies the function to be called when the window is scrolled.

    MDN

  99. var onseeked: Function1[Event, _]

  100. var onseeking: Function1[Event, _]

  101. var onselect: Function1[UIEvent, _]

    An event handler property for window selection.

    An event handler property for window selection.

    MDN

  102. var onstalled: Function1[Event, _]

  103. var onstorage: Function1[StorageEvent, _]

  104. var onsubmit: Function1[Event, _]

    An event handler property for submits on window forms.

    An event handler property for submits on window forms.

    MDN

  105. var onsuspend: Function1[Event, _]

  106. var ontimeupdate: Function1[Event, _]

  107. var onunload: Function1[Event, _]

    The unload event is raised when the window is unloading its content and resources.

    The unload event is raised when the window is unloading its content and resources. The resources removal is processed  after the unload event occurs.

    MDN

  108. var onvolumechange: Function1[Event, _]

  109. var onwaiting: Function1[Event, _]

  110. def open(url: String = js.native, target: String = js.native, features: String = js.native, replace: Boolean = js.native): Window

    Loads a resource in a new browsing context or an existing one.

    Loads a resource in a new browsing context or an existing one.

    MDN

  111. var opener: Window

    Returns a reference to the window that opened this current window.

    Returns a reference to the window that opened this current window.

    MDN

  112. def outerHeight: Int

    window.outerHeight gets the height in pixels of the whole browser window.

    window.outerHeight gets the height in pixels of the whole browser window. It represents the height of the whole browser window including sidebar (if expanded), window chrome and window resizing borders/handles.

    MDN

  113. def outerWidth: Int

    window.outerWidth gets the width of the outside of the browser window.

    window.outerWidth gets the width of the outside of the browser window. It represents the width of the whole browser window including sidebar (if expanded), window chrome and window resizing borders/handles.

    MDN

  114. def pageXOffset: Int

    Returns the number of pixels that the document has already been scrolled horizontally.

    Returns the number of pixels that the document has already been scrolled horizontally.

    MDN

  115. def pageYOffset: Int

    Returns the number of pixels that the document has already been scrolled vertically.

    Returns the number of pixels that the document has already been scrolled vertically.

    MDN

  116. def parent: Window

    Returns a reference to the parent of the current window or subframe.

    Returns a reference to the parent of the current window or subframe.

    MDN

  117. def performance: Performance

    The Web Performance API allows web pages access to certain functions for measuring the performance of web pages and web applications, including the Navigation Timing API and high-resolution time data.

    The Web Performance API allows web pages access to certain functions for measuring the performance of web pages and web applications, including the Navigation Timing API and high-resolution time data.

    MDN

  118. def postMessage(message: Any, targetOrigin: String, transfer: Any = js.native): Unit

    The window.postMessage method safely enables cross-origin communication.

    The window.postMessage method safely enables cross-origin communication. Normally, scripts on different pages are allowed to access each other if and only if the pages that executed them are at locations with the same protocol (usually both http), port number (80 being the default for http), and host (modulo document.domain being set by both pages to the same value). window.postMessage provides a controlled mechanism to circumvent this restriction in a way which is secure when properly used.

    MDN

  119. def print(): Unit

    Opens the Print Dialog to print the current document.

    Opens the Print Dialog to print the current document.

    MDN

  120. def prompt(): String

    The Window.prompt() displays a dialog with an optional message prompting the user to input some text.

    The Window.prompt() displays a dialog with an optional message prompting the user to input some text.

    MDN

  121. def prompt(message: String, default: String = js.native): String

  122. def propertyIsEnumerable(v: String): Boolean

    Definition Classes
    Object
  123. def removeEventListener(type: String, listener: Function1[Event, _], useCapture: Boolean = js.native): Unit

    Removes the event listener previously registered with EventTarget.addEventListener.

    Removes the event listener previously registered with EventTarget.addEventListener.

    MDN

    Definition Classes
    EventTarget
  124. def requestAnimationFrame(callback: Function1[Double, _]): Int

    The window.requestAnimationFrame() method tells the browser that you wish to perform an animation and requests that the browser call a specified function to update an animation before the next repaint.

    The window.requestAnimationFrame() method tells the browser that you wish to perform an animation and requests that the browser call a specified function to update an animation before the next repaint. The method takes as an argument a callback to be invoked before the repaint.

    MDN

  125. def screen: Screen

    Specifies the height of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the Taskbar on Windows.

    Specifies the height of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the Taskbar on Windows.

    MDN

  126. var screenX: Int

    Returns the horizontal distance of the left border of the user's browser from the left side of the screen.

    Returns the horizontal distance of the left border of the user's browser from the left side of the screen.

    MDN

  127. def screenY: Int

    Returns the vertical distance of the top border of the user's browser from the top edge of the screen.

    Returns the vertical distance of the top border of the user's browser from the top edge of the screen.

    MDN

  128. def scroll(x: Int, y: Int): Unit

    Scrolls the window to a particular place in the document.

    Scrolls the window to a particular place in the document.

    MDN

  129. def scrollBy(x: Int, y: Int): Unit

    Scrolls the document in the window by the given amount.

    Scrolls the document in the window by the given amount.

    MDN

  130. def scrollTo(x: Int, y: Int): Unit

    Scrolls to a particular set of coordinates in the document.

    Scrolls to a particular set of coordinates in the document.

    MDN

  131. def self: Window

    Returns an object reference to the window object itself.

    Returns an object reference to the window object itself.

    MDN

  132. def sessionStorage: Storage

    This is a global object (sessionStorage) that maintains a storage area that's available for the duration of the page session.

    This is a global object (sessionStorage) that maintains a storage area that's available for the duration of the page session. A page session lasts for as long as the browser is open and survives over page reloads and restores. Opening a page in a new tab or window will cause a new session to be initiated.

    MDN

    Definition Classes
    WindowSessionStorage
  133. def setImmediate(handler: Function0[Any]): Int

    Definition Classes
    WindowTimersExtension
  134. def setInterval(handler: Function0[Any], timeout: Double): Int

    Calls a function or executes a code snippet repeatedly, with a fixed time delay between each call to that function.

    Calls a function or executes a code snippet repeatedly, with a fixed time delay between each call to that function.

    MDN

    Definition Classes
    WindowTimers
  135. def setTimeout(handler: Function0[Any], timeout: Double): Int

    Calls a function or executes a code snippet after a specified delay.

    Calls a function or executes a code snippet after a specified delay.

    MDN

    Definition Classes
    WindowTimers
  136. def showModalDialog(url: String = js.native, argument: Any = js.native, options: Any = js.native): Dynamic

    The Window.showModalDialog() creates and displays a modal dialog box containing a specified HTML document.

    The Window.showModalDialog() creates and displays a modal dialog box containing a specified HTML document.

    url

    The URI of the document to display in the dialog box

    argument

    An optional variant the contains values that should be passed to the dialog box; these are made available in the window object's dialogArguments property.

    options

    An optional String that specifies window ornamentation

  137. def styleMedia: StyleMedia

  138. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  139. def toLocaleString(): String

    Definition Classes
    Object
  140. def toString(): String

    Definition Classes
    AnyRef → Any
  141. def top: Window

    Returns a reference to the topmost window in the window hierarchy.

    Returns a reference to the topmost window in the window hierarchy. This property is read only.

    MDN

  142. def valueOf(): Any

    Definition Classes
    Object
  143. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  144. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  145. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  146. def window: Window

    The window property of a window object points to the window object itself.

    The window property of a window object points to the window object itself.

    MDN

  147. Inherited from WindowConsole

    Inherited from IDBEnvironment

    Inherited from WindowBase64

    Inherited from WindowTimers

    Inherited from WindowTimersExtension

    Inherited from WindowSessionStorage

    Inherited from WindowLocalStorage

    Inherited from EventTarget

    Inherited from Object

    Inherited from Any

    Inherited from AnyRef

    Inherited from Any

    Ungrouped