java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.event.EventTarget
org.htmlunit.javascript.host.worker.WorkerGlobalScope
org.htmlunit.javascript.host.worker.DedicatedWorkerGlobalScope
- All Implemented Interfaces:
Serializable,Cloneable,org.htmlunit.corejs.javascript.ConstProperties<org.htmlunit.corejs.javascript.Scriptable>,org.htmlunit.corejs.javascript.debug.DebuggableObject,org.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>,org.htmlunit.corejs.javascript.Scriptable,org.htmlunit.corejs.javascript.SymbolScriptable,WindowOrWorkerGlobalScope
The scope for the execution of
Workers.- Author:
- Marc Guillemot, Ronald Brill, Rural Hunter
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.ScriptableObject.DescriptorInfo, org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunction -
Field Summary
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
isSealedFields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.htmlunit.corejs.javascript.FunctionReturns theonmessageevent handler.org.htmlunit.corejs.javascript.ScriptablegetPrototype(Class<? extends HtmlUnitScriptable> jsClass) Returns the prototype object corresponding to the specified HtmlUnit class inside the window scope.getSelf()Get the scope itself.static voidimportScripts(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function funObj) Import external script(s).voidJavaScript constructor.voidjsSetName(org.htmlunit.corejs.javascript.Scriptable name) Sets thename.voidpostMessage(Object message) Posts a message to theWorkerin the page's context.static ObjectsetInterval(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function) Sets a chunk of JavaScript to be invoked each time a specified number of milliseconds has elapsed.voidsetOnmessage(Object onmessage) Sets theonmessageevent handler.voidsetPrototypes(Map<Class<? extends org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.Scriptable> map) Sets the prototypes for HtmlUnit host classes.static ObjectsetTimeout(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function) Sets a chunk of JavaScript to be invoked at some specified time later.Methods inherited from class org.htmlunit.javascript.host.worker.WorkerGlobalScope
atob, btoaMethods inherited from class org.htmlunit.javascript.host.event.EventTarget
addEventListener, clearEventListenersContainer, dispatchEvent, executeEventLocally, fireEvent, getEventHandler, getEventListenersContainer, hasEventHandlers, isEventHandlerOnWindow, removeEventListener, setEventHandlerMethods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getScriptableFor, getWindow, getWindow, getWindowOrWorkerGlobalScope, getWithPreemption, has, hasInstance, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setupPromise, setupRejectedPromiseMethods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkPropertyDefinition, checkSlotRemoval, defineBuiltinProperty, defineBuiltinProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, get, get, getAllIds, getAncestor, getArrayPrototype, getClassPrototype, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getThis, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasProperty, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isTrue, preventExtensions, put, put, putConst, putConstProperty, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, redefineProperty, sameValue, sealObject, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, sizeMethods inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
associateValue, checkNotSealed, copyAssociatedValue, createSlotMap, defineProperty, defineProperty, get, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getIds, has, has, isSealed, readMaps, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, writeMapsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.htmlunit.corejs.javascript.Scriptable
get, getIds, has, hasMethods inherited from interface org.htmlunit.corejs.javascript.SymbolScriptable
get, has
-
Constructor Details
-
DedicatedWorkerGlobalScope
public DedicatedWorkerGlobalScope()For prototype instantiation.
-
-
Method Details
-
jsConstructor
public void jsConstructor()JavaScript constructor.- Overrides:
jsConstructorin classWorkerGlobalScope
-
getSelf
Get the scope itself.- Returns:
- this
-
getOnmessage
public org.htmlunit.corejs.javascript.Function getOnmessage()Returns theonmessageevent handler.- Returns:
- the
onmessageevent handler
-
setOnmessage
Sets theonmessageevent handler.- Parameters:
onmessage- theonmessageevent handler
-
getLocation
- Returns:
- returns the WorkerLocation associated with the worker
-
jsGetName
- Returns:
- the
name
-
jsSetName
public void jsSetName(org.htmlunit.corejs.javascript.Scriptable name) Sets thename.- Parameters:
name- the new name
-
postMessage
Posts a message to theWorkerin the page's context.- Parameters:
message- the message
-
importScripts
public static void importScripts(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function funObj) throws IOException Import external script(s).- Parameters:
cx- the current contextscope- the scopethisObj- this objectargs- the script(s) to importfunObj- the JS function called- Throws:
IOException- in case of problem loading/executing the scripts
-
setTimeout
public static Object setTimeout(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function) Sets a chunk of JavaScript to be invoked at some specified time later. The invocation occurs only if the window is opened after the delay and does not contain another page than the one that originated the setTimeout.- Parameters:
context- the JavaScript contextscope- the scopethisObj- the scriptableargs- the arguments passed into the methodfunction- the function- Returns:
- the id of the created timer
- See Also:
-
setInterval
public static Object setInterval(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function) Sets a chunk of JavaScript to be invoked each time a specified number of milliseconds has elapsed.- Parameters:
context- the JavaScript contextscope- the scopethisObj- the scriptableargs- the arguments passed into the methodfunction- the function- Returns:
- the id of the created interval
- See Also:
-
getPrototype
public org.htmlunit.corejs.javascript.Scriptable getPrototype(Class<? extends HtmlUnitScriptable> jsClass) Returns the prototype object corresponding to the specified HtmlUnit class inside the window scope.- Overrides:
getPrototypein classHtmlUnitScriptable- Parameters:
jsClass- the class whose prototype is to be returned- Returns:
- the prototype object corresponding to the specified class inside the specified scope
-
setPrototypes
public void setPrototypes(Map<Class<? extends org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.Scriptable> map) Sets the prototypes for HtmlUnit host classes.- Parameters:
map- a Map of (Class,Scriptable)
-