class Window extends Object
Window object
- Annotations
- @RawJSType() @native() @JSGlobal( "Window" )
- See also
https://developer.mozilla.org/en-US/docs/Web/API/Window
- Alphabetic
- By Inheritance
- Window
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Window()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
Components: Object
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.
-
var
MozWebSocket: UndefOr[WebSocket]
TBD
-
def
URL: Window.URL
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.
-
var
WebSocket: UndefOr[WebSocket]
TODO
- def _content: Object
-
def
alert(message: |[String, Any] = js.native): Unit
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
-
def
applicationCache: OfflineResourceList
Read-only: An OfflineResourceList object providing access to the offline resources for the window.
-
def
apply(index: Int): Frame
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()
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
atob(encodedStr: String): String
Decodes a base-64 encoded string
Decodes a base-64 encoded string
- encodedStr
Required. The string which has been encoded by the btoa() method
-
def
blur(): Unit
Removes focus from the current window
-
def
btoa(str: String): String
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
-
def
caches: CacheStorage
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.
-
def
clearInterval(interval: Interval): Unit
Clears a timer set with setInterval()
Clears a timer set with setInterval()
- interval
Required. The ID of the timer returned by the setInterval() method
-
def
clearTimeout(timeout: Timeout): Unit
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
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
close(): Unit
Closes the current window
-
def
closed: Boolean
Read-only: This property indicates whether the current window is closed or not.
-
def
confirm(message: |[String, Any] = js.native): Unit
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
-
def
console: Console
Read-only: Returns a reference to the console object which provides access to the browser's debugging console.
-
def
content: Object
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.
-
def
controllers: XULControllers
Read-only: Returns the XUL controller objects for the current chrome window.
-
def
crypto: Object
Read-only: Returns the browser crypto object.
-
def
defaultStatus: String
Gets/sets the status bar text for the given window (Obsolete since Gecko 23).
-
def
devicePixelRatio: Double
Read-only: Returns the ratio between physical pixels and device independent pixels in the current display.
-
def
dialogArguments: Object
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.
-
def
directories: Object
Synonym of window.personalbar
-
def
document: Document
Read-only: Returns a reference to the document that the window contains.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
focus(): Unit
Sets focus to the current window
-
def
frameElement: Element
Read-only: Returns the element in which the window is embedded, or null if the window is not embedded.
-
def
frames: Array[Frame]
Read-only: Returns an array of the subframes in the current window.
-
def
fullScreen: Boolean
This property indicates whether the window is displayed in full screen or not.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getComputedStyle(element: Element, pseudoElement: Element = js.native): CSSStyleDeclaration
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.
-
def
getSelection(): Selection
Returns a Selection object representing the range of text selected by the user
-
def
globalStorage: LocalStorage
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).
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
history: History
Read-only: Returns a reference to the history object.
-
def
innerHeight: Int
Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
-
def
innerWidth: Int
Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
def
isSecureContext: Boolean
Read-only: Indicates whether a context is capable of using features that require secure contexts.
-
def
length: Int
Read-only: Returns the number of frames in the window.
Read-only: Returns the number of frames in the window. See also window.frames.
-
def
localStorage: LocalStorage
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.
-
def
location: Location
Read-only: Gets/sets the location, or current URL, of the window object.
-
def
locationbar: Any
Read-only: Returns the locationbar object, whose visibility can be toggled in the window.
-
def
matchMedia(mediaQueryString: String): MediaQueryList
Returns a MediaQueryList object representing the specified CSS media query string
-
def
menubar: Menubar
Read-only: Returns the menubar object, whose visibility can be toggled in the window.
-
def
messageManager: Any
Returns the message manager object for this window.
-
def
moveBy(deltaX: Int, deltaY: Int): Unit
Moves a window relative to its current position
-
def
moveTo(x: Int, y: Int): Unit
Moves a window to the specified position
-
def
mozAnimationStartTime: Int
Read-only: The time in milliseconds since epoch at which the current animation cycle began.
-
def
mozInnerScreenX: Int
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.
-
def
mozInnerScreenY: Int
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.
-
def
mozPaintCount: Int
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.
-
def
name: String
Gets/sets the name of the window.
-
def
navigator: Navigator
Read-only: Returns a reference to the navigator object.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
open(url: String, windowName: String, windowFeatures: Any = js.native): Window.this.type
Opens a new browser window
-
def
openDialog(url: String, name: String, features: String, args: Any*): Window.this.type
Opens a new dialog window.
-
def
opener: Any
Returns a reference to the window that opened this current window.
-
def
orientation: Any
Read-only: Returns the orientation in degrees (in 90 degree increments) of the viewport relative to the device's natural orientation.
-
def
outerHeight: Int
Read-only: Gets the height of the outside of the browser window.
-
def
outerWidth: Int
Read-only: Gets the width of the outside of the browser window.
-
def
pageXOffset: Int
Read-only: An alias for window.scrollX.
-
def
pageYOffset: Int
Read-only: An alias for window.scrollY
-
def
parent: Frame
Read-only: Returns a reference to the parent of the current window or subframe.
-
def
performance: Performance
Read-only: Provides a hosting area for performance related attributes.
-
def
personalbar: String
Read-only: Returns the personalbar object, whose visibility can be toggled in the window.
-
def
pkcs11: String
Formerly provided access to install and remove PKCS11 modules (Obsolete since Gecko 29)
-
def
postMessage(message: String, targetOrigin: String, transfer: Boolean = 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 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.
-
def
print(): Unit
Prints the content of the current window
-
def
prompt(message: String, default: String = js.native): 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.
- 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.
-
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.
- returns
a string containing the text entered by the user, or null.
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
resizeBy(xDelta: Int, yDelta: Int): Unit
Resizes the window by the specified pixels
-
def
resizeTo(aWidth: Int, aHeight: Int): Unit
Resizes the window to the specified width and height
-
def
returnValue: Any
The return value to be returned to the function that called window.showModalDialog() to display the window as a modal dialog.
-
def
screen: Any
Read-only: Returns a reference to the screen object associated with the window.
-
def
screenX: Int
Read-only: Returns the horizontal distance of the left border of the user's browser from the left side of the screen.
-
def
screenY: Int
Read-only: Returns the vertical distance of the top border of the user's browser from the top side of the screen.
-
def
scroll(x_coord: Int, y_coord: Int): Unit
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.
-
def
scrollBy(x: Int, y: Int): Unit
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.
-
def
scrollMaxX: Int
Read-only: The maximum offset that the window can be scrolled to horizontally, that is the document width minus the viewport width.
-
def
scrollMaxY: Int
Read-only: The maximum offset that the window can be scrolled to vertically (i.e., the document height minus the viewport height).
-
def
scrollTo(x_coord: Int, y_coord: Int): Unit
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.
-
def
scrollX: Int
Read-only: Returns the number of pixels that the document has already been scrolled horizontally.
-
def
scrollY: Int
Read only: Returns the number of pixels that the document has already been scrolled vertically.
-
def
scrollbars: Any
Read-only: Returns the scrollbars object, whose visibility can be toggled in the window.
-
def
self: Window.this.type
Read-only: Returns an object reference to the window object itself.
-
def
sessionStorage: SessionStorage
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.
-
def
setInterval(func: |[Function, String], delay: Int, params: Any*): Interval
Calls a function or evaluates an expression at specified intervals (in milliseconds)
-
def
setTimeout(func: |[Function, String], delay: Int, params: Any*): Timeout
Calls a function or evaluates an expression after a specified number of milliseconds
-
def
sidebar: Window.this.type
Read-only: Returns a reference to the window object of the sidebar.
-
def
speechSynthesis: SpeechSynthesis
Read-only: Returns a SpeechSynthesis object, which is the entry point into using Web Speech API speech synthesis functionality.
-
var
status: String
Gets/sets the text in the statusbar at the bottom of the browser.
-
def
statusbar: Any
Read-only: Returns the statusbar object, whose visibility can be toggled in the window.
-
def
stop(): Unit
Stops the window from loading
-
def
storageStorage: Any
Returns a storage object for storing data within a single page session.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
toolbar: Any
Read-only: Returns the toolbar object, whose visibility can be toggled in the window.
-
def
top: Any
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.
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
window: Window.this.type
Read-only: Returns a reference to the current window.