Module org.htmlunit

Class DedicatedWorkerGlobalScope

java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
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

public class DedicatedWorkerGlobalScope extends WorkerGlobalScope
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_CONST

    Fields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner

    isSealed

    Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable

    NOT_FOUND
  • Constructor Summary

    Constructors
    Constructor
    Description
    For prototype instantiation.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the WorkerLocation associated with the worker.
    Returns the WorkerNavigator associated with the worker.
    org.htmlunit.corejs.javascript.Function
    Returns the onmessage event handler.
    org.htmlunit.corejs.javascript.Scriptable
    Returns the prototype object corresponding to the specified HtmlUnit class inside the worker scope.
    Returns the scope itself.
    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)
    Imports one or more external scripts into the worker's scope.
    void
    Creates an instance of this object.
    Returns the name of the worker.
    void
    jsSetName(org.htmlunit.corejs.javascript.Scriptable name)
    Sets the name of the worker.
    void
    Posts a message to the Worker in the page's context.
    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.
    void
    setOnmessage(Object onmessage)
    Sets the onmessage event handler.
    void
    setPrototypes(Map<Class<? extends org.htmlunit.corejs.javascript.Scriptable>,org.htmlunit.corejs.javascript.Scriptable> map)
    Sets the prototypes for HtmlUnit host classes.
    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.

    Methods inherited from class org.htmlunit.javascript.host.worker.WorkerGlobalScope

    atob, btoa

    Methods 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, size

    Methods 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, writeMaps

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.htmlunit.corejs.javascript.Scriptable

    get, getIds, has, has

    Methods 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:
      jsConstructor in class WorkerGlobalScope
    • getSelf

      public Object getSelf()
      Returns the scope itself.
      Returns:
      this scope
    • getOnmessage

      public org.htmlunit.corejs.javascript.Function getOnmessage()
      Returns the onmessage event handler.
      Returns:
      the onmessage event handler
    • setOnmessage

      public void setOnmessage(Object onmessage)
      Sets the onmessage event handler.
      Parameters:
      onmessage - the onmessage event handler
    • getLocation

      public WorkerLocation getLocation()
      Returns the WorkerLocation associated with the worker.
      Returns:
      the worker location
    • getNavigator

      public WorkerNavigator getNavigator()
      Returns the WorkerNavigator associated with the worker.
      Returns:
      the worker navigator
    • jsGetName

      public String jsGetName()
      Returns the name of the worker.
      Returns:
      the worker name
    • jsSetName

      public void jsSetName(org.htmlunit.corejs.javascript.Scriptable name)
      Sets the name of the worker.
      Parameters:
      name - the new name
    • postMessage

      public void postMessage(Object message)
      Posts a message to the Worker in 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 context
      scope - the scope
      thisObj - this object
      args - the script URL(s) to import
      funObj - 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 context
      scope - the scope
      thisObj - the scriptable
      args - the arguments passed into the method
      function - 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 context
      scope - the scope
      thisObj - the scriptable
      args - the arguments passed into the method
      function - 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:
      getPrototype in class HtmlUnitScriptable
      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