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 TypeMethodDescriptionReturns theWorkerLocationassociated with the worker.Returns theWorkerNavigatorassociated with the worker.org.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 worker scope.getSelf()Returns 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) Imports one or more external scripts into the worker's scope.voidCreates an instance of this object.Returns thenameof the worker.voidjsSetName(org.htmlunit.corejs.javascript.Scriptable name) Sets thenameof the worker.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 repeatedly at the specified interval.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 after the specified delay.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()Creates an instance of this object.- Overrides:
jsConstructorin classWorkerGlobalScope
-
getSelf
Returns the scope itself.- Returns:
- this scope
-
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 theWorkerLocationassociated with the worker.- Returns:
- the worker location
-
jsGetName
Returns thenameof the worker.- Returns:
- the worker name
-
jsSetName
public void jsSetName(org.htmlunit.corejs.javascript.Scriptable name) Sets thenameof the worker.- Parameters:
name- the new name
-
postMessage
Posts a message to theWorkerin the page's context.- Parameters:
message- the message to post
-
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 Imports one or more external scripts into the worker's scope.- Parameters:
cx- the current contextscope- the scopethisObj- this objectargs- the script URL(s) to importfunObj- the JS function called- Throws:
IOException- in case of problem loading or 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 after the specified delay. The invocation occurs only if the window is still open after the delay and has not been replaced by another page.- 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 repeatedly at the specified interval.- 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 worker scope.- Overrides:
getPrototypein classHtmlUnitScriptable- Parameters:
jsClass- the class whose prototype is to be returned- Returns:
- the prototype object corresponding to the specified class
-
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) prototype entries
-