This specification is like no other — it has been processed with you, the humble web developer, in mind.
The focus of this specification is readability and ease of access. Unlike the full HTML Standard, this "developer's edition" removes information that only browser vendors need know. It is automatically produced from the full specification by our build tooling, and thus always in sync with the latest developments in HTML.
To read about its conception, construction, and future, read the original press release, and the blog post about its relaunch.
Finally, feel free to contribute on GitHub to make this edition better for everyone!
Window
objectwindow
frames
self
These attributes all return window.
document
Returns the Document
associated with window.
defaultView
Returns the Window
object of the active document.
open
( [ url [, target [, features ] ] ] )Opens a window to show url (defaults to about:blank
), and returns it.
The target argument gives the name of the new window. If a window exists with that
name already, it is reused. The features argument can be used to influence the
rendering of the new window.
name
[ = value ]Returns the name of the window.
Can be set, to change the name.
close
()Closes the window.
closed
Returns true if the window has been closed, false otherwise.
stop
()Cancels the document load.
length
Returns the number of document-tree child browsing contexts.
Returns the indicated document-tree child browsing context.
Window
objectReturns the indicated element or collection of elements.
As a general rule, relying on this will lead to brittle code. Which IDs end up mapping to
this API can vary over time, as new features are added to the Web platform, for example. Instead
of this, use document.getElementById()
or document.querySelector()
.
To close a browsing context browsingContext, run these steps:
Prompt to unload browsingContext's active document. If the user refused to allow the document to be unloaded, then return.
Unload browsingContext's active document with the recycle parameter set to false.
Remove browsingContext from the user interface (e.g., close or hide its tab in a tabbed browser).
Discard browsingContext.
User agents should offer users the ability to arbitrarily close any top-level browsing context.
To allow Web pages to integrate with Web browsers, certain Web browser interface elements are exposed in a limited way to scripts in Web pages.
Each interface element is represented by a BarProp
object:
locationbar
. visible
Returns true if the location bar is visible; otherwise, returns false.
menubar
. visible
Returns true if the menu bar is visible; otherwise, returns false.
personalbar
. visible
Returns true if the personal bar is visible; otherwise, returns false.
scrollbars
. visible
Returns true if the scroll bars are visible; otherwise, returns false.
statusbar
. visible
Returns true if the status bar is visible; otherwise, returns false.
toolbar
. visible
Returns true if the toolbar is visible; otherwise, returns false.