Module org.htmlunit

Class WindowOrWorkerGlobalScopeMixin

java.lang.Object
org.htmlunit.javascript.host.WindowOrWorkerGlobalScopeMixin

public final class WindowOrWorkerGlobalScopeMixin extends Object
The implementation of WindowOrWorkerGlobalScope to be used by the implementers of the mixin.
Author:
Ronald Brill, Rural Hunter, Lai Quang Duong
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    atob(String encodedData, HtmlUnitScriptable scriptable)
    Decodes a string of data that has been encoded using Base64 encoding.
    static String
    btoa(String stringToEncode, HtmlUnitScriptable scriptable)
    Creates a Base64-encoded ASCII string from a string of binary data.
    static Object
    queueMicrotask(org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args)
    Queues a microtask to be executed.
    static Object
    setInterval(org.htmlunit.corejs.javascript.Context context, 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.
    static Object
    setTimeout(org.htmlunit.corejs.javascript.Context context, 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 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • atob

      public static String atob(String encodedData, HtmlUnitScriptable scriptable)
      Decodes a string of data that has been encoded using Base64 encoding.
      Parameters:
      encodedData - the Base64-encoded string to decode
      scriptable - the calling HtmlUnitScriptable
      Returns:
      the decoded value
    • btoa

      public static String btoa(String stringToEncode, HtmlUnitScriptable scriptable)
      Creates a Base64-encoded ASCII string from a string of binary data.
      Parameters:
      stringToEncode - the Latin-1 string to encode
      scriptable - the calling HtmlUnitScriptable
      Returns:
      the Base64-encoded string
    • setTimeout

      public static Object setTimeout(org.htmlunit.corejs.javascript.Context context, 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
      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 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
      thisObj - the scriptable
      args - the arguments passed into the method
      function - the function
      Returns:
      the id of the created interval
      See Also:
    • queueMicrotask

      public static Object queueMicrotask(org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args)
      Queues a microtask to be executed.
      Parameters:
      thisObj - the scriptable
      args - the arguments passed into the method
      Returns:
      undefined
      See Also: