Class/Object

io.scalajs.dom.html.browser

Window

Related Docs: object Window | package browser

Permalink

class Window extends Object

Window object

Annotations
@RawJSType() @native()
See also

https://developer.mozilla.org/en-US/docs/Web/API/Window

Linear Supertypes
Object, Any, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Window
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Window()

    Permalink

Value Members

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def Components: Object

    Permalink

    The entry point to many XPCOM features.

    The entry point to many XPCOM features. Some properties, e.g. classes, are only available to sufficiently privileged code. Web code should not use this property.

  5. var MozWebSocket: UndefOr[WebSocket]

    Permalink

    TBD

  6. def URL: Window.URL

    Permalink

    returns an object that provides static methods used for creating and managing object URLs.

    returns an object that provides static methods used for creating and managing object URLs. It can also be called as a constructor to construct URL objects.

  7. var WebSocket: UndefOr[WebSocket]

    Permalink

    TODO

  8. def _content: Object

    Permalink
  9. def alert(message: |[String, Any] = js.native): Unit

    Permalink

    Displays an alert box with a message and an OK button

    Displays an alert box with a message and an OK button

    message

    Optional. Specifies the text to display in the alert box, or an object converted into a string and displayed

  10. def applicationCache: OfflineResourceList

    Permalink

    Read-only: An OfflineResourceList object providing access to the offline resources for the window.

  11. def apply(index: Int): Frame

    Permalink

    Returns a reference to the window object in the frames.

    Returns a reference to the window object in the frames. See Window.frames for more details.

    index

    the window index

    returns

    the window instance at the given index

    Annotations
    @JSBracketAccess()
  12. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  13. def atob(encodedStr: String): String

    Permalink

    Decodes a base-64 encoded string

    Decodes a base-64 encoded string

    encodedStr

    Required. The string which has been encoded by the btoa() method

  14. def blur(): Unit

    Permalink

    Removes focus from the current window

  15. def btoa(str: String): String

    Permalink

    Encodes a string in base-64

    Encodes a string in base-64

    str

    Required. The string to be encoded

    returns

    A String, representing the base-64 encoded string

  16. def caches: CacheStorage

    Permalink

    Read-only: Returns the CacheStorage object associated with the current origin.

    Read-only: Returns the CacheStorage object associated with the current origin. This object enables service worker functionality such as storing assets for offline use, and generating custom responses to requests.

  17. def clearInterval(interval: Interval): Unit

    Permalink

    Clears a timer set with setInterval()

    Clears a timer set with setInterval()

    interval

    Required. The ID of the timer returned by the setInterval() method

  18. def clearTimeout(timeout: Timeout): Unit

    Permalink

    Clears a timer set with setTimeout()

    Clears a timer set with setTimeout()

    timeout

    Required. The ID value of the timer returned by the setTimeout() method

  19. def clone(): AnyRef

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

    Permalink

    Closes the current window

  21. def closed: Boolean

    Permalink

    Read-only: This property indicates whether the current window is closed or not.

  22. def confirm(message: |[String, Any] = js.native): Unit

    Permalink

    Displays a dialog box with a message and an OK and a Cancel button

    Displays a dialog box with a message and an OK and a Cancel button

    message

    Optional. Specifies the text to display in the confirm box

  23. def console: Console

    Permalink

    Read-only: Returns a reference to the console object which provides access to the browser's debugging console.

  24. def content: Object

    Permalink

    Read-only: Returns a reference to the content element in the current window.

    Read-only: Returns a reference to the content element in the current window. The obsolete variant with underscore is no longer available from Web content.

  25. def controllers: XULControllers

    Permalink

    Read-only: Returns the XUL controller objects for the current chrome window.

  26. def crypto: Object

    Permalink

    Read-only: Returns the browser crypto object.

  27. def defaultStatus: String

    Permalink

    Gets/sets the status bar text for the given window (Obsolete since Gecko 23).

  28. def devicePixelRatio: Double

    Permalink

    Read-only: Returns the ratio between physical pixels and device independent pixels in the current display.

  29. def dialogArguments: Object

    Permalink

    Read-only: Gets the arguments passed to the window (if it's a dialog box) at the time window.showModalDialog() was called.

    Read-only: Gets the arguments passed to the window (if it's a dialog box) at the time window.showModalDialog() was called. This is an nsIArray.

  30. def directories: Object

    Permalink

    Synonym of window.personalbar

  31. def document: Document

    Permalink

    Read-only: Returns a reference to the document that the window contains.

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

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

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

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

    Permalink

    Sets focus to the current window

  36. def frameElement: Element

    Permalink

    Read-only: Returns the element in which the window is embedded, or null if the window is not embedded.

  37. def frames: Array[Frame]

    Permalink

    Read-only: Returns an array of the subframes in the current window.

  38. def fullScreen: Boolean

    Permalink

    This property indicates whether the window is displayed in full screen or not.

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

    Permalink
    Definition Classes
    AnyRef → Any
  40. def getComputedStyle(element: Element, pseudoElement: Element = js.native): CSSStyleDeclaration

    Permalink

    Gets the current computed CSS styles applied to an element

    Gets the current computed CSS styles applied to an element

    element

    Required. The element to get the computed style for

    pseudoElement

    Optional. A pseudo-element to get

    returns

    A CSSStyleDeclaration object containing CSS declaration block of the element.

  41. def getSelection(): Selection

    Permalink

    Returns a Selection object representing the range of text selected by the user

  42. def globalStorage: LocalStorage

    Permalink

    Unsupported since Gecko 13 (Firefox 13).

    Unsupported since Gecko 13 (Firefox 13). Use Window.localStorage instead. Was: Multiple storage objects that are used for storing data across multiple pages (Obsolete since Gecko 13).

  43. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  44. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  45. def history: History

    Permalink

    Read-only: Returns a reference to the history object.

  46. def innerHeight: Int

    Permalink

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

  47. def innerWidth: Int

    Permalink

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

  48. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    Object
  50. def isSecureContext: Boolean

    Permalink

    Read-only: Indicates whether a context is capable of using features that require secure contexts.

  51. def length: Int

    Permalink

    Read-only: Returns the number of frames in the window.

    Read-only: Returns the number of frames in the window. See also window.frames.

  52. def localStorage: LocalStorage

    Permalink

    Read-only: Returns a reference to the local storage object used to store data that may only be accessed by the origin that created it.

  53. def location: Location

    Permalink

    Read-only: Gets/sets the location, or current URL, of the window object.

  54. def locationbar: Any

    Permalink

    Read-only: Returns the locationbar object, whose visibility can be toggled in the window.

  55. def matchMedia(mediaQueryString: String): MediaQueryList

    Permalink

    Returns a MediaQueryList object representing the specified CSS media query string

  56. def menubar: Menubar

    Permalink

    Read-only: Returns the menubar object, whose visibility can be toggled in the window.

  57. def messageManager: Any

    Permalink

    Returns the message manager object for this window.

  58. def moveBy(deltaX: Int, deltaY: Int): Unit

    Permalink

    Moves a window relative to its current position

  59. def moveTo(x: Int, y: Int): Unit

    Permalink

    Moves a window to the specified position

  60. def mozAnimationStartTime: Int

    Permalink

    Read-only: The time in milliseconds since epoch at which the current animation cycle began.

  61. def mozInnerScreenX: Int

    Permalink

    Read-only: Returns the horizontal (X) coordinate of the top-left corner of the window's viewport, in screen coordinates.

    Read-only: Returns the horizontal (X) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel in nsIDOMWindowUtils for a conversion factor to adapt to screen pixels if needed.

  62. def mozInnerScreenY: Int

    Permalink

    Read-only: Returns the vertical (Y) coordinate of the top-left corner of the window's viewport, in screen coordinates.

    Read-only: Returns the vertical (Y) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel for a conversion factor to adapt to screen pixels if needed.

  63. def mozPaintCount: Int

    Permalink

    Read-only: Returns the number of times the current document has been rendered to the screen in this window.

    Read-only: Returns the number of times the current document has been rendered to the screen in this window. This can be used to compute rendering performance.

  64. def name: String

    Permalink

    Gets/sets the name of the window.

  65. def navigator: Navigator

    Permalink

    Read-only: Returns a reference to the navigator object.

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

    Permalink
    Definition Classes
    AnyRef
  67. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  68. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  69. def open(url: String, windowName: String, windowFeatures: Any = js.native): Window.this.type

    Permalink

    Opens a new browser window

  70. def openDialog(url: String, name: String, features: String, args: Any*): Window.this.type

    Permalink

    Opens a new dialog window.

  71. def opener: Any

    Permalink

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

  72. def orientation: Any

    Permalink

    Read-only: Returns the orientation in degrees (in 90 degree increments) of the viewport relative to the device's natural orientation.

  73. def outerHeight: Int

    Permalink

    Read-only: Gets the height of the outside of the browser window.

  74. def outerWidth: Int

    Permalink

    Read-only: Gets the width of the outside of the browser window.

  75. def pageXOffset: Int

    Permalink

    Read-only: An alias for window.scrollX.

  76. def pageYOffset: Int

    Permalink

    Read-only: An alias for window.scrollY

  77. def parent: Frame

    Permalink

    Read-only: Returns a reference to the parent of the current window or subframe.

  78. def performance: Performance

    Permalink

    Read-only: Provides a hosting area for performance related attributes.

  79. def personalbar: String

    Permalink

    Read-only: Returns the personalbar object, whose visibility can be toggled in the window.

  80. def pkcs11: String

    Permalink

    Formerly provided access to install and remove PKCS11 modules (Obsolete since Gecko 29)

  81. def postMessage(message: String, targetOrigin: String, transfer: Boolean = js.native): Unit

    Permalink

    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 https), port number (443 being the default for https), 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.

    message

    Data to be sent to the other window. The data is serialized using the structured clone algorithm. This means you can pass a broad variety of data objects safely to the destination window without having to serialize them yourself.

    targetOrigin

    Specifies what the origin of otherWindow must be for the event to be dispatched, either as the literal string "*" (indicating no preference) or as a URI. If at the time the event is scheduled to be dispatched the scheme, hostname, or port of otherWindow's document does not match that provided in targetOrigin, the event will not be dispatched; only if all three match will the event be dispatched. This mechanism provides control over where messages are sent.

    transfer

    Optional: Is a sequence of Transferable objects that are transferred with the message. The ownership of these objects is given to the destination side and they are no longer usable on the sending side.

  82. def print(): Unit

    Permalink

    Prints the content of the current window

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

    Permalink

    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.

    message

    is a string of text to display to the user. This parameter is optional and can be omitted if there is nothing to show in the prompt window.

    default

    is a string containing the default value displayed in the text input field. It is an optional parameter. Note that in Internet Explorer 7 and 8, if you do not provide this parameter, the string "undefined" is the default value.

    returns

    a string containing the text entered by the user, or null.

  84. def prompt(): String

    Permalink

    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.

    returns

    a string containing the text entered by the user, or null.

  85. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  86. def resizeBy(xDelta: Int, yDelta: Int): Unit

    Permalink

    Resizes the window by the specified pixels

  87. def resizeTo(aWidth: Int, aHeight: Int): Unit

    Permalink

    Resizes the window to the specified width and height

  88. def returnValue: Any

    Permalink

    The return value to be returned to the function that called window.showModalDialog() to display the window as a modal dialog.

  89. def screen: Any

    Permalink

    Read-only: Returns a reference to the screen object associated with the window.

  90. def screenX: Int

    Permalink

    Read-only: Returns the horizontal distance of the left border of the user's browser from the left side of the screen.

  91. def screenY: Int

    Permalink

    Read-only: Returns the vertical distance of the top border of the user's browser from the top side of the screen.

  92. def scroll(x_coord: Int, y_coord: Int): Unit

    Permalink

    Deprecated.

    Deprecated. This method has been replaced by the scrollTo() method.

    x_coord

    is the pixel along the horizontal axis of the document that you want displayed in the upper left.

    y_coord

    is the pixel along the vertical axis of the document that you want displayed in the upper left.

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

    Permalink

    Scrolls the document by the specified number of pixels

    Scrolls the document by the specified number of pixels

    x

    is the offset in pixels to scroll horizontally.

    y

    is the offset in pixels to scroll vertically.

  94. def scrollMaxX: Int

    Permalink

    Read-only: The maximum offset that the window can be scrolled to horizontally, that is the document width minus the viewport width.

  95. def scrollMaxY: Int

    Permalink

    Read-only: The maximum offset that the window can be scrolled to vertically (i.e., the document height minus the viewport height).

  96. def scrollTo(x_coord: Int, y_coord: Int): Unit

    Permalink

    Scrolls the document to the specified coordinates

    Scrolls the document to the specified coordinates

    x_coord

    is the pixel along the horizontal axis of the document that you want displayed in the upper left.

    y_coord

    is the pixel along the vertical axis of the document that you want displayed in the upper left.

  97. def scrollX: Int

    Permalink

    Read-only: Returns the number of pixels that the document has already been scrolled horizontally.

  98. def scrollY: Int

    Permalink

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

  99. def scrollbars: Any

    Permalink

    Read-only: Returns the scrollbars object, whose visibility can be toggled in the window.

  100. def self: Window.this.type

    Permalink

    Read-only: Returns an object reference to the window object itself.

  101. def sessionStorage: SessionStorage

    Permalink

    Read-only: Returns a reference to the session storage object used to store data that may only be accessed by the origin that created it.

  102. def setInterval(func: |[Function, String], delay: Int, params: Any*): Interval

    Permalink

    Calls a function or evaluates an expression at specified intervals (in milliseconds)

  103. def setTimeout(func: |[Function, String], delay: Int, params: Any*): Timeout

    Permalink

    Calls a function or evaluates an expression after a specified number of milliseconds

  104. def sidebar: Window.this.type

    Permalink

    Read-only: Returns a reference to the window object of the sidebar.

  105. def speechSynthesis: SpeechSynthesis

    Permalink

    Read-only: Returns a SpeechSynthesis object, which is the entry point into using Web Speech API speech synthesis functionality.

  106. var status: String

    Permalink

    Gets/sets the text in the statusbar at the bottom of the browser.

  107. def statusbar: Any

    Permalink

    Read-only: Returns the statusbar object, whose visibility can be toggled in the window.

  108. def stop(): Unit

    Permalink

    Stops the window from loading

  109. def storageStorage: Any

    Permalink

    Returns a storage object for storing data within a single page session.

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

    Permalink
    Definition Classes
    AnyRef
  111. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  112. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  113. def toolbar: Any

    Permalink

    Read-only: Returns the toolbar object, whose visibility can be toggled in the window.

  114. def top: Any

    Permalink

    Read-only: Returns a reference to the topmost window in the window hierarchy.

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

  115. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  116. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  119. def window: Window.this.type

    Permalink

    Read-only: Returns a reference to the current window.

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped