--- title: Window slug: Web/API/Window tags: - DOM - Gecko - Reference_del_DOM_di_Gecko - SezioneIncompleta - TraduzioneIncompleta - Tutte_le_categorie translation_of: Web/API/Window ---

{{ ApiRef() }}

Introduzione

Questo capitolo contiene una breve reference per tutti i metodi, proprietà, ed eventi disponibili attraverso l'oggetto window del DOM. L'oggetto window implementa l'interfacciawindow , la quale eredita dall'interfaccia AbstractView.

L'oggetto window rappresenta una finestra, contenente un documento DOM. La proprietà document punta ad un DOM document ( documento DOM ) caricato in quella pagina

Ogni tab che viene aperta contiene il suo personale oggetto window; ciò significa che l'oggetto window non è condiviso fra le varie tab aperte nella stessa finestra. Solo due metodi vengono condivisi dai vari oggetti window presenti in una stessa finestra, e sono i metodi window.resizeTo e window.resizeBy.

Proprietà

window.Components
The entry point to many XPCOM features. Some properties, e.g. classes, are only available to sufficiently privileged code.
window.content and window._content
Returns a reference to the content element in the current window. The variant with underscore is deprecated.
window.closed
This property indicates whether the current window is closed or not.
window.controllers
Returns the XUL controller objects for the current chrome window.
window.crypto
Returns the browser crypto object.
window.defaultStatus
Gets/sets the status bar text for the given window.
window.directories
Returns a reference to the directories toolbar in the current chrome.
window.document
Returns a reference to the document that the window contains.
window.frameElement
Returns the element in which the window is embedded, or null if the window is not embedded.
window.frames
Returns an array of the subframes in the current window.
window.history
Returns a reference to the history object.
window.innerHeight
Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
window.innerWidth
Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
window.length
Returns the number of frames in the window.
window.location
Gets/sets the location, or current URL, of the window object.
window.locationbar
Returns the locationbar object, whose visibility can be toggled in the window.
window.menubar
Returns the menubar object, whose visibility can be toggled in the window.
window.name
Gets/sets the name of the window.
window.navigator
Returns a reference to the navigator object.
window.navigator.appCodeName
Returns the internal "code" name of the current browser.
window.navigator.appName
Returns the official name of the browser.
window.navigator.appVersion
Returns the version of the browser as a string.
window.navigator.cookieEnabled
Returns a boolean indicating whether cookies are enabled in the browser or not.
window.navigator.javaEnabled()
Indicates whether Java is enabled in the host browser.
window.navigator.language
Returns a string representing the language version of the browser.
window.navigator.mimeTypes
Returns a list of the MIME types supported by the browser.
window.navigator.oscpu
Returns a string that represents the current operating system.
window.navigator.platform
Returns a string representing the platform of the browser.
window.navigator.plugins
Returns an array of the plugins installed in the browser.
window.navigator.product
Returns the product name of the browser (e.g. "Gecko").
window.navigator.productSub
Returns the product version number (e.g. "5.0").
window.navigator.userAgent
Returns the user agent string for the current browser.
window.navigator.vendor
Returns the vendor name of the current browser (e.g. "Netscape6").
window.navigator.vendorSub
Returns the vendor version number (e.g. "6.1").
window.opener
Returns a reference to the window that opened this current window.
window.outerHeight
Gets the height of the outside of the browser window.
window.outerWidth
Gets the width of the outside of the browser window.
window.pageXOffset
Gets the amount of content that has been hidden by scrolling to the right.
window.pageYOffset
Gets the amount of content that has been hidden by scrolling down.
window.parent
Returns a reference to the parent of the current window or subframe.
window.personalbar
Returns the personalbar object, whose visibility can be toggled in the window.
window.pkcs11
Returns the pkcs11 object, which can be used to install drivers and other software associated with the pkcs11 protocol.
window.prompter
Returns a reference to the prompt window, if any, currently displayed.
window.screen
Returns a reference to the screen object associated with the window.

The following is duplicated on DOM:window.screen

window.screen.availTop
Specifies the y-coordinate of the first pixel that is not allocated to permanent or semipermanent user interface features.
window.screen.availLeft
Returns the first available pixel available from the left side of the screen.
window.screen.availHeight
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.
window.screen.availWidth
Returns the amount of horizontal space in pixels available to the window.
window.screen.colorDepth
Returns the color depth of the screen.
window.screen.height
Returns the height of the screen in pixels.
window.screen.left
Gets/sets the current distance in pixels from the left side of the screen.
window.screen.pixelDepth
Gets the bit depth of the screen.
window.screen.top
Gets/sets the distance from the top of the screen.
window.screen.width
Returns the width of the screen.

end of duplicated content

window.screenX
Returns the horizontal distance of the left border of the user's browser from the left side of the screen.
window.screenY
Returns the vertical distance of the top border of the user's browser from the top side of the screen.
window.scrollbars
Returns the scrollbars object, whose visibility can be toggled in the window.
window.scrollMaxX
The maximum offset that the window can be scrolled to horizontally.
(i.e., the document width minus the viewport width)
window.scrollMaxY
The maximum offset that the window can be scrolled to vertically.
(i.e., the document height minus the viewport height)
window.scrollX
Returns the number of pixels that the document has already been scrolled horizontally.
window.scrollY
Returns the number of pixels that the document has already been scrolled vertically.
window.self
Returns an object reference to the window object itself.
window.sidebar
Returns a reference to the window object of the sidebar.
window.status
Gets/sets the text in the statusbar at the bottom of the browser.
window.statusbar
Returns the statusbar object, whose visibility can be toggled in the window.
window.toolbar
Returns the toolbar object, whose visibility can be toggled in the window.
window.top
Returns a reference to the topmost window in the window hierarchy.
window.window
Returns a reference to the current window.

Metodi

window.alert
Displays an alert dialog.

base64 func https://bugzilla.mozilla.org/show_bug.cgi?id=287112 (see last comments) https://bugzilla.mozilla.org/show_bug.cgi?id=123003 http://lxr.mozilla.org/seamonkey/sou...indow.cpp#4946

window.atob
Decodes a string of data which has been encoded using base-64 encoding.
window.back
Moves back one in the window history.
window.blur
Sets focus away from the window.
window.btoa
Creates a base-64 encoded ASCII string from a string of binary data.
window.captureEvents {{ Obsolete_inline() }}
Registers the window to capture all events of the specified type.
window.clearInterval
Cancels the repeated execution set using setInterval.
window.clearTimeout
Clears a delay that's been set for a specific function.
window.close
Closes the current window.
window.confirm
Displays a dialog with a message that the user needs to respond to.
window.dump
Writes a message to the console.
window.escape
Encodes a string.
window.focus
Sets focus on the current window.
window.forward
Moves the window one document forward in the history.
window.getAttention
Flashes the application icon.
window.getComputedStyle
Gets computed style for the specified element. Computed style indicates the computed values of all CSS properties of the element.
window.getSelection
Returns the selection object representing the selected item(s).
window.home
Returns the browser to the home page.
window.moveBy
Moves the current window by a specified amount.
window.moveTo
Moves the window to the specified coordinates.
window.open
Opens a new window.
window.openDialog
Opens a new dialog window.
window.print
Prints the current document.
window.prompt
Returns the text entered by the user in a prompt dialog.
window.releaseEvents {{ Obsolete_inline() }}
Releases the window from trapping events of a specific type.
window.resizeBy
Resizes the current window by a certain amount.
window.resizeTo
Dynamically resizes window.
window.scroll
Scrolls the window to a particular place in the document.
window.scrollBy
Scrolls the document in the window by the given amount.
window.scrollByLines
Scrolls the document by the given number of lines.
window.scrollByPages
Scrolls the current document by the specified number of pages.
window.scrollTo
Scrolls to a particular set of coordinates in the document.
window.setInterval
Execute a function each X milliseconds.
window.setTimeout
Sets a delay for executing a function.
window.sizeToContent
Sizes the window according to its content.
window.stop
This method stops window loading.
window.unescape
Unencodes a value that has been encoded in hexadecimal (e.g. a cookie).
window.updateCommands

Gestori di Eventi

window.onabort
An event handler property for abort events on the window.
window.onblur
An event handler property for blur events on the window.
window.onchange
An event handler property for change events on the window.
window.onclick
An event handler property for click events on the window.
window.onclose
An event handler property for handling the window close event.
window.ondragdrop
An event handler property for drag and drop events on the window.
window.onerror
An event handler property for errors raised on the window.
window.onfocus
An event handler property for focus events on the window.
window.onkeydown
An event handler property for keydown events on the window.
window.onkeypress
An event handler property for keypress events on the window.
window.onkeyup
An event handler property for keyup events on the window.
window.onload
An event handler property for window loading.
window.onmousedown
An event handler property for mousedown events on the window.
window.onmousemove
An event handler property for mousemove events on the window.
window.onmouseout
An event handler property for mouseout events on the window.
window.onmouseover
An event handler property for mouseover events on the window.
window.onmouseup
An event handler property for mouseup events on the window.
window.onpaint
An event handler property for paint events on the window.
window.onreset
An event handler property for reset events on the window.
window.onresize
An event handler property for window resizing.
window.onscroll
An event handler property for window scrolling.
window.onselect
An event handler property for window selection.
window.onsubmit
An event handler property for submits on window forms.
window.onunload
An event handler property for unload events on the window.

{{ languages( { "fr": "fr/DOM/window", "pl": "pl/DOM/window", "en": "en/DOM/window" } ) }}