public class Window extends EventTarget implements ScriptableWithFallbackGetter, net.sourceforge.htmlunit.corejs.javascript.Function
Window.| Modifier and Type | Field and Description |
|---|---|
static short |
PERSISTENT
To be documented.
|
static short |
TEMPORARY
To be documented.
|
| Constructor and Description |
|---|
Window()
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
alert(Object message)
The JavaScript function
alert(). |
String |
atob(String encodedData)
Decodes a string of data which has been encoded using base-64 encoding..
|
void |
blur()
Removes focus from this element.
|
String |
btoa(String stringToEncode)
Creates a base-64 encoded ASCII string from a string of binary data.
|
Object |
call(net.sourceforge.htmlunit.corejs.javascript.Context cx,
net.sourceforge.htmlunit.corejs.javascript.Scriptable scope,
net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args) |
void |
cancelAnimationFrame(Object requestId)
Dummy implementation for cancelAnimationFrame.
|
void |
captureEvents(String type)
Does nothing special anymore...
|
void |
clearComputedStyles()
Clears the computed styles.
|
void |
clearInterval(int intervalID)
Cancels the interval previously started using the setInterval method.
|
void |
clearTimeout(int timeoutId)
Cancels a time-out previously set with the setTimeout method.
|
void |
close()
Closes this window.
|
void |
CollectGarbage()
An undocumented IE function.
|
boolean |
confirm(String message)
The JavaScript function "confirm()".
|
net.sourceforge.htmlunit.corejs.javascript.Scriptable |
construct(net.sourceforge.htmlunit.corejs.javascript.Context cx,
net.sourceforge.htmlunit.corejs.javascript.Scriptable scope,
Object[] args) |
boolean |
dispatchEvent(Event event)
Dispatches an event into the event system (standards-conformant browsers only).
|
void |
dump(String message)
Prints messages to the console.
|
boolean |
find(String search,
boolean caseSensitive,
boolean backwards,
boolean wrapAround,
boolean wholeWord,
boolean searchInFrames,
boolean showDialog)
Stub only at the moment.
|
void |
focus()
Sets the focus to this element.
|
Object |
get(int index,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start) |
ApplicationCache |
getApplicationCache()
Returns the application cache.
|
Navigator |
getClientInformation()
Returns the JavaScript property
clientInformation. |
DataTransfer |
getClipboardData()
Returns the JavaScript property
clipboardData. |
boolean |
getClosed()
Indicates if this window is closed.
|
CSS2Properties |
getComputedStyle(Element element,
String pseudoElement)
Returns computed style of the element.
|
net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
getConsole()
Returns the console property.
|
Object |
getControllers()
Gets the controllers.
|
Crypto |
getCrypto()
Returns the crypto property.
|
Event |
getCurrentEvent()
Returns the current event (used internally regardless of the emulation mode).
|
int |
getDevicePixelRatio()
Returns the
devicePixelRatio property. |
DocumentProxy |
getDocument_js()
Returns the JavaScript property
document. |
Document |
getDocument()
Returns the window's current document.
|
Object |
getEvent()
Returns the current event (used by JavaScript only when emulating IE).
|
External |
getExternal()
Returns the
external property. |
Object |
getFrameElement()
Returns the (i)frame in which the window is contained.
|
WindowProxy |
getFrames_js()
Returns the value of the frames property.
|
History |
getHistory()
Returns the
history property. |
int |
getInnerHeight()
Returns the innerHeight.
|
int |
getInnerWidth()
Returns the innerWidth.
|
int |
getLength()
Returns the number of frames contained by this window.
|
Storage |
getLocalStorage()
Returns the localStorage property.
|
Location |
getLocation()
Returns the location property.
|
int |
getMozInnerScreenX()
Returns the value of
mozInnerScreenX property. |
int |
getMozInnerScreenY()
Returns the value of
mozInnerScreenY property. |
int |
getMozPaintCount()
Returns the value of
mozPaintCount property. |
String |
getName()
Returns the value of the window's
name property. |
Navigator |
getNavigator()
Returns the JavaScript property
navigator. |
Netscape |
getNetscape()
Returns the value of
netscape property. |
Object |
getOffscreenBuffering()
Returns the
offscreenBuffering property. |
Object |
getOnbeforeunload()
Returns the value of the window's
onbeforeunload property. |
Object |
getOnchange()
Getter for the onchange event handler.
|
Object |
getOnclick()
Returns the onclick property (caution this is not necessary a function if something else has
been set).
|
Object |
getOndblclick()
Returns the ondblclick property (caution this is not necessary a function if something else has
been set).
|
Object |
getOnerror()
Returns the value of the window's
onerror property. |
Object |
getOnhashchange()
Returns the onhashchange property (caution this is not necessary a function if something else has
been set).
|
Object |
getOnload()
Returns the onload property.
|
Object |
getOnmessage()
Returns the value of the window's
onmessage property. |
Object |
getOnsubmit()
Getter for the onsubmit event handler.
|
Object |
getOpener()
Returns the value of the opener property.
|
int |
getOuterHeight()
Returns the outer height.
|
int |
getOuterWidth()
Returns the outerWidth.
|
int |
getPageXOffset()
Returns the value of
pageXOffset property. |
int |
getPageYOffset()
Returns the value of
pageYOffset property. |
WindowProxy |
getParent()
Returns the value of the parent property.
|
Performance |
getPerformance()
Returns the
performance property. |
static int |
getPort(URL url)
Returns the port of the specified URL.
|
net.sourceforge.htmlunit.corejs.javascript.Scriptable |
getPrototype(Class<? extends SimpleScriptable> jsClass)
Returns the prototype object corresponding to the specified HtmlUnit class inside the window scope.
|
net.sourceforge.htmlunit.corejs.javascript.Scriptable |
getPrototype(String className)
Returns the prototype object corresponding to the specified HtmlUnit class inside the window scope.
|
static WindowProxy |
getProxy(WebWindow w)
Returns the proxy for the specified window.
|
Screen |
getScreen()
Returns the
screen property. |
int |
getScrollX()
Returns the value of
scrollX property. |
int |
getScrollY()
Returns the value of
scrollY property. |
Selection |
getSelection()
Returns the current selection.
|
Selection |
getSelectionImpl()
Returns the current selection.
|
WindowProxy |
getSelf()
Returns the
self property. |
Storage |
getSessionStorage()
Returns the sessionStorage property.
|
SpeechSynthesis |
getSpeechSynthesis()
Returns the
speechSynthesis property. |
String |
getStatus()
Returns the text from the status line.
|
Storage |
getStorage(StorageHolder.Type storageType)
Gets the storage of the specified type.
|
StyleMedia |
getStyleMedia()
Returns the
styleMedia property. |
Object |
getTop()
Returns the value of the top property.
|
WebWindow |
getWebWindow()
Returns the WebWindow associated with this Window.
|
WindowProxy |
getWindow_js()
Returns the window property.
|
Object |
getWithFallback(String name)
Fallback called when no configured property is found with the given name
on the
Scriptable object. |
void |
initialize()
Initializes the object.
|
void |
initialize(Page enclosedPage)
Initialize the object.
|
void |
initialize(WebWindow webWindow)
Initializes this window.
|
boolean |
isConst(String name)
Used to allow re-declaration of constants (eg: "var undefined;").
|
MediaQueryList |
matchMedia(String mediaQueryString)
Returns a new MediaQueryList object representing the parsed results of the specified media query string.
|
void |
moveBy(int x,
int y)
Does nothing.
|
void |
moveTo(int x,
int y)
Does nothing.
|
void |
navigate(String url)
Loads the new HTML document corresponding to the specified URL.
|
WindowProxy |
open(Object url,
Object name,
Object features,
Object replace)
Opens a new window.
|
void |
postMessage(String message,
String targetOrigin,
Object transfer)
Posts a message.
|
void |
print()
Prints the current page.
|
String |
prompt(String message)
The JavaScript function "prompt()".
|
int |
requestAnimationFrame(Object callback)
Dummy implementation for requestAnimationFrame.
|
void |
resizeBy(int width,
int height)
Does nothing.
|
void |
resizeTo(int width,
int height)
Does nothing.
|
String |
ScriptEngine()
Gets the name of the scripting engine.
|
int |
ScriptEngineBuildVersion()
Gets the build version of the scripting engine.
|
int |
ScriptEngineMajorVersion()
Gets the major version of the scripting engine.
|
int |
ScriptEngineMinorVersion()
Gets the minor version of the scripting engine.
|
void |
scroll(int x,
int y)
Scrolls to the specified location on the page.
|
void |
scrollBy(int x,
int y)
Scrolls the window content the specified distance.
|
void |
scrollByLines(int lines)
Scrolls the window content down by the specified number of lines.
|
void |
scrollByPages(int pages)
Scrolls the window content down by the specified number of pages.
|
void |
scrollTo(int x,
int y)
Scrolls to the specified location on the page.
|
void |
setConsole(net.sourceforge.htmlunit.corejs.javascript.ScriptableObject console)
Sets the console.
|
void |
setControllers(Object value)
Sets the controllers.
|
void |
setCurrentEvent(Event event)
Sets the current event.
|
int |
setInterval(Object code,
int timeout,
Object language)
Sets a chunk of JavaScript to be invoked each time a specified number of milliseconds has elapsed.
|
void |
setLocation(String newLocation)
Sets the location property.
|
void |
setName(String name)
Sets the value of the window's
name property. |
void |
setOnbeforeunload(Object onbeforeunload)
Sets the value of the window's
onbeforeunload property. |
void |
setOnchange(Object onchange)
Setter for the onchange event handler.
|
void |
setOnclick(Object newOnload)
Sets the value of the onclick event handler.
|
void |
setOndblclick(Object newHandler)
Sets the value of the ondblclick event handler.
|
void |
setOnerror(Object onerror)
Sets the value of the window's
onerror property. |
void |
setOnhashchange(Object newHandler)
Sets the value of the onhashchange event handler.
|
void |
setOnload(Object newOnload)
Sets the value of the onload event handler.
|
void |
setOnmessage(Object onmessage)
Sets the value of the window's
onmessage property. |
void |
setOnsubmit(Object onsubmit)
Setter for the onsubmit event handler.
|
void |
setOpener(Object newValue)
Sets the opener property.
|
void |
setPrototypes(Map<Class<? extends net.sourceforge.htmlunit.corejs.javascript.Scriptable>,net.sourceforge.htmlunit.corejs.javascript.Scriptable> map,
Map<String,net.sourceforge.htmlunit.corejs.javascript.Scriptable> prototypesPerJSName)
Sets the prototypes for HtmlUnit host classes.
|
void |
setStatus(String message)
Sets the text from the status line.
|
int |
setTimeout(Object code,
int timeout,
Object language)
Sets a chunk of JavaScript to be invoked at some specified time later.
|
void |
setTop(Object o)
Sets the value of the top property.
|
Object |
showModalDialog(String url,
Object arguments,
String features)
Creates a modal dialog box that displays the specified HTML document.
|
Object |
showModelessDialog(String url,
Object arguments,
String features)
Creates a modeless dialog box that displays the specified HTML document.
|
void |
stop()
Should implement the stop() function on the window object.
|
void |
triggerOnError(ScriptException e)
Triggers the onerror handler, if one has been set.
|
addEventListener, clearEventListenersContainer, executeEventLocally, fireEvent, getEventHandler, getEventHandlerProp, getEventListenersContainer, hasEventHandlers, removeEventListener, setEventHandler, setEventHandlerPropclone, equivalentValues, get, getBrowserVersion, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElementdefineFunctionProperties, defineProperty, getClassName, setClassName, setParentScopeapplyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setPrototype, sizepublic static final short TEMPORARY
public static final short PERSISTENT
public net.sourceforge.htmlunit.corejs.javascript.Scriptable getPrototype(Class<? extends SimpleScriptable> jsClass)
getPrototype in class SimpleScriptablejsClass - the class whose prototype is to be returnedpublic net.sourceforge.htmlunit.corejs.javascript.Scriptable getPrototype(String className)
className - the class name whose prototype is to be returnedpublic void setPrototypes(Map<Class<? extends net.sourceforge.htmlunit.corejs.javascript.Scriptable>,net.sourceforge.htmlunit.corejs.javascript.Scriptable> map, Map<String,net.sourceforge.htmlunit.corejs.javascript.Scriptable> prototypesPerJSName)
public void alert(Object message)
alert().message - the messagepublic String btoa(String stringToEncode)
stringToEncode - string to encodepublic String atob(String encodedData)
encodedData - the encoded stringpublic boolean confirm(String message)
message - the messagepublic String prompt(String message)
message - the messagepublic DocumentProxy getDocument_js()
document.public Document getDocument()
public ApplicationCache getApplicationCache()
public Object getEvent()
null if no event is currently availablepublic Event getCurrentEvent()
null if no event is currently availablepublic void setCurrentEvent(Event event)
event - the current eventpublic WindowProxy open(Object url, Object name, Object features, Object replace)
url - when a new document is opened, url is a String that specifies a MIME type for the document.
When a new window is opened, url is a String that specifies the URL to render in the new windowname - the namefeatures - the featuresreplace - whether to replace in the history list or nonull if popup windows have been disabledWebClientOptions.isPopupBlockerEnabled(),
MSDN documentationpublic int setTimeout(Object code, int timeout, Object language)
code - specifies the function pointer or string that indicates the code to be executed
when the specified interval has elapsedtimeout - specifies the number of millisecondslanguage - specifies languagepublic void clearTimeout(int timeoutId)
timeoutId - identifier for the timeout to clear (returned by setTimeout)public Navigator getNavigator()
navigator.public Navigator getClientInformation()
clientInformation.public DataTransfer getClipboardData()
clipboardData.DataTransferpublic WindowProxy getWindow_js()
public WindowProxy getSelf()
self property.public Storage getLocalStorage()
public Storage getSessionStorage()
public Storage getStorage(StorageHolder.Type storageType)
storageType - the typepublic Location getLocation()
public void setLocation(String newLocation) throws IOException
newLocation - the URL of the new contentIOException - when location loading failspublic net.sourceforge.htmlunit.corejs.javascript.ScriptableObject getConsole()
public void setConsole(net.sourceforge.htmlunit.corejs.javascript.ScriptableObject console)
console - the consolepublic void dump(String message)
message - the message to logpublic int requestAnimationFrame(Object callback)
callback - the function to call when it's time to update the animationpublic void cancelAnimationFrame(Object requestId)
requestId - the ID value returned by the call to window.requestAnimationFrame()public Screen getScreen()
screen property.public History getHistory()
history property.history propertypublic External getExternal()
external property.external propertypublic void initialize(WebWindow webWindow)
webWindow - the web window corresponding to this windowpublic void initialize(Page enclosedPage)
enclosedPage - the page containing the JavaScriptpublic void initialize()
public Object getTop()
public void setTop(Object o)
o - the new valuepublic WindowProxy getParent()
public Object getOpener()
null for a top level windowpublic void setOpener(Object newValue)
newValue - the new valuepublic Object getFrameElement()
null for a top level windowpublic WindowProxy getFrames_js()
public int getLength()
public WebWindow getWebWindow()
public void focus()
public void blur()
public void close()
public boolean getClosed()
true if this window is closedpublic void moveTo(int x,
int y)
x - the horizontal positiony - the vertical positionpublic void moveBy(int x,
int y)
x - the horizontal positiony - the vertical positionpublic void navigate(String url) throws IOException
url - the location of the new HTML document to loadIOException - if loading the specified location failspublic void resizeBy(int width,
int height)
width - the width offsetheight - the height offsetpublic void resizeTo(int width,
int height)
width - the width of the Window in pixel after resizeheight - the height of the Window in pixel after resizepublic void scroll(int x,
int y)
x - the horizontal position to scroll toy - the vertical position to scroll topublic void scrollBy(int x,
int y)
x - the horizontal distance to scroll byy - the vertical distance to scroll bypublic void scrollByLines(int lines)
lines - the number of lines to scroll downpublic void scrollByPages(int pages)
pages - the number of pages to scroll downpublic void scrollTo(int x,
int y)
x - the horizontal position to scroll toy - the vertical position to scroll topublic Object getOnload()
public void setOnload(Object newOnload)
newOnload - the new handlerpublic Object getOnclick()
public void setOnclick(Object newOnload)
newOnload - the new handlerpublic Object getOndblclick()
public void setOndblclick(Object newHandler)
newHandler - the new handlerpublic Object getOnhashchange()
public void setOnhashchange(Object newHandler)
newHandler - the new handlerpublic String getName()
name property.name propertypublic void setName(String name)
name property.name - the value of the window's name propertypublic Object getOnbeforeunload()
onbeforeunload property.onbeforeunload propertypublic void setOnbeforeunload(Object onbeforeunload)
onbeforeunload property.onbeforeunload - the value of the window's onbeforeunload propertypublic Object getOnerror()
onerror property.onerror propertypublic void setOnerror(Object onerror)
onerror property.onerror - the value of the window's onerror propertypublic Object getOnmessage()
onmessage property.onmessage propertypublic void setOnmessage(Object onmessage)
onmessage property.onmessage - the value of the window's onmessage propertypublic void triggerOnError(ScriptException e)
e - the error that needs to be reportedpublic Object call(net.sourceforge.htmlunit.corejs.javascript.Context cx, net.sourceforge.htmlunit.corejs.javascript.Scriptable scope, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args)
call in interface net.sourceforge.htmlunit.corejs.javascript.Callablecall in interface net.sourceforge.htmlunit.corejs.javascript.Functionpublic net.sourceforge.htmlunit.corejs.javascript.Scriptable construct(net.sourceforge.htmlunit.corejs.javascript.Context cx,
net.sourceforge.htmlunit.corejs.javascript.Scriptable scope,
Object[] args)
construct in interface net.sourceforge.htmlunit.corejs.javascript.Functionpublic Object getWithFallback(String name)
Scriptable object.getWithFallback in interface ScriptableWithFallbackGettername - the name of the requested propertyScriptable.NOT_FOUND if nothing is foundpublic Object get(int index, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
get in interface net.sourceforge.htmlunit.corejs.javascript.Scriptableget in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObjectpublic static WindowProxy getProxy(WebWindow w)
w - the window whose proxy is to be returnedpublic String getStatus()
public void setStatus(String message)
message - the status line textpublic int setInterval(Object code, int timeout, Object language)
code - specifies the function pointer or string that indicates the code to be executed
when the specified interval has elapsedtimeout - specifies the number of millisecondslanguage - specifies languagepublic void clearInterval(int intervalID)
intervalID - specifies the interval to cancel as returned by the setInterval methodpublic int getInnerWidth()
public int getOuterWidth()
public int getInnerHeight()
public int getOuterHeight()
public void print()
public void captureEvents(String type)
type - the type of events to captureDocument.captureEvents(String)public void CollectGarbage()
public CSS2Properties getComputedStyle(Element element, String pseudoElement)
element - the elementpseudoElement - a string specifying the pseudo-element to match (may be null)public Selection getSelection()
public Selection getSelectionImpl()
public Object showModalDialog(String url, Object arguments, String features)
url - the URL of the document to load and displayarguments - object to be made available via window.dialogArguments in the dialog windowfeatures - string that specifies the window ornaments for the dialog windowreturnValue property as set by the modal dialog's windowpublic Object showModelessDialog(String url, Object arguments, String features)
url - the URL of the document to load and displayarguments - object to be made available via window.dialogArguments in the dialog windowfeatures - string that specifies the window ornaments for the dialog windowpublic Object getControllers()
public void setControllers(Object value)
value - the new valuepublic int getMozInnerScreenX()
mozInnerScreenX property.mozInnerScreenX propertypublic int getMozInnerScreenY()
mozInnerScreenY property.mozInnerScreenY propertypublic int getMozPaintCount()
mozPaintCount property.mozPaintCount propertypublic void clearComputedStyles()
public String ScriptEngine()
public int ScriptEngineBuildVersion()
public int ScriptEngineMajorVersion()
public int ScriptEngineMinorVersion()
public void stop()
public int getPageXOffset()
pageXOffset property.pageXOffset propertypublic int getPageYOffset()
pageYOffset property.pageYOffset propertypublic int getScrollX()
scrollX property.scrollX propertypublic int getScrollY()
scrollY property.scrollY propertypublic Netscape getNetscape()
netscape property.netscape propertypublic boolean isConst(String name)
isConst in interface net.sourceforge.htmlunit.corejs.javascript.ConstPropertiesisConst in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObjectpublic boolean dispatchEvent(Event event)
dispatchEvent in class EventTargetevent - the event to be dispatchedfalse if at least one of the event handlers which handled the event
called preventDefault; true otherwisepublic Object getOnchange()
public void setOnchange(Object onchange)
onchange - the handlerpublic Object getOnsubmit()
public void setOnsubmit(Object onsubmit)
onsubmit - the handlerpublic void postMessage(String message, String targetOrigin, Object transfer)
message - the object passed to the windowtargetOrigin - the origin this window must be for the event to be dispatchedtransfer - an optional sequence of Transferable objectspublic static int getPort(URL url)
url - the URLpublic Performance getPerformance()
performance property.performance propertypublic int getDevicePixelRatio()
devicePixelRatio property.devicePixelRatio propertypublic StyleMedia getStyleMedia()
styleMedia property.styleMedia propertypublic MediaQueryList matchMedia(String mediaQueryString)
mediaQueryString - the media querypublic boolean find(String search, boolean caseSensitive, boolean backwards, boolean wrapAround, boolean wholeWord, boolean searchInFrames, boolean showDialog)
search - the text string for which to searchcaseSensitive - if true, specifies a case-sensitive searchbackwards - if true, specifies a backward searchwrapAround - if true, specifies a wrap around searchwholeWord - if true, specifies a whole word searchsearchInFrames - if true, specifies a search in framesshowDialog - if true, specifies a show Dialog.public SpeechSynthesis getSpeechSynthesis()
speechSynthesis property.speechSynthesis propertypublic Object getOffscreenBuffering()
offscreenBuffering property.offscreenBuffering propertypublic Crypto getCrypto()
Copyright © 2002–2016 Gargoyle Software Inc.. All rights reserved.