This section provides a brief reference for all of the methods, properties, and events available through the DOM window
object. The window
object implements the Window
interface, which in turn inherits from the AbstractView
interface. Some additional global functions, namespaces objects, and constructors, not typically associated with the window, but available on it, are listed in the JavaScript Reference.
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.
nsIDOMOfflineResourceList
object providing access to the offline resources for the window.window.frames
.window.scrollX
.window.scrollY
window.URL
Requires Gecko 2.0
window.URL.createObjectURL()
and window.URL.revokeObjectURL()
methods.0
, window1
, etc.window
object in the frames. See window.frames
for more details.