Class DedicatedWorkerGlobalScope

java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.event.EventTarget
org.htmlunit.javascript.host.worker.DedicatedWorkerGlobalScope
All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable, WindowOrWorkerGlobalScope

public class DedicatedWorkerGlobalScope extends EventTarget implements 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.KeyComparator
  • Field Summary

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

    CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST

    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
    atob(String encodedData)
    Decodes a string of data which has been encoded using base-64 encoding.
    btoa(String stringToEncode)
    Creates a base-64 encoded ASCII string from a string of binary data.
    org.htmlunit.corejs.javascript.Function
    Returns the onmessage event handler.
    Get the scope itself.
    static void
    importScripts(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function funObj)
    Import external script(s).
    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.Scriptable 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.
    void
    setOnmessage(Object onmessage)
    Sets the onmessage event handler.
    static Object
    setTimeout(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable 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.corejs.javascript.ScriptableObject

    applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size

    Methods inherited from class Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DedicatedWorkerGlobalScope

      public DedicatedWorkerGlobalScope()
      For prototype instantiation.
  • Method Details

    • getSelf

      public Object getSelf()
      Get the scope itself.
      Returns:
      this
    • 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
    • btoa

      public String btoa(String stringToEncode)
      Creates a base-64 encoded ASCII string from a string of binary data.
      Specified by:
      btoa in interface WindowOrWorkerGlobalScope
      Parameters:
      stringToEncode - string to encode
      Returns:
      the encoded string
    • atob

      public String atob(String encodedData)
      Decodes a string of data which has been encoded using base-64 encoding.
      Specified by:
      atob in interface WindowOrWorkerGlobalScope
      Parameters:
      encodedData - the encoded string
      Returns:
      the decoded value
    • postMessage

      public void postMessage(Object message)
      Posts a message to the Worker in the page's context.
      Parameters:
      message - the message
    • importScripts

      public static void importScripts(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.Scriptable 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 context
      scope - the scope
      thisObj - this object
      args - the script(s) to import
      funObj - 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.Scriptable 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 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.Scriptable 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 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: