java.lang.Object
org.htmlunit.javascript.host.WindowOrWorkerGlobalScopeMixin
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 TypeMethodDescriptionstatic Stringatob(String encodedData, HtmlUnitScriptable scriptable) Decodes a string of data which has been encoded using base-64 encoding.static Stringbtoa(String stringToEncode, HtmlUnitScriptable scriptable) Creates a base-64 encoded ASCII string from a string of binary data.static ObjectqueueMicrotask(org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args) Queues a microtask to be executed.static ObjectsetInterval(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 each time a specified number of milliseconds has elapsed.static ObjectsetTimeout(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 at some specified time later.
-
Method Details
-
atob
Decodes a string of data which has been encoded using base-64 encoding.- Parameters:
encodedData- the encoded stringscriptable- the HtmlUnitScriptable- Returns:
- the decoded value
-
btoa
Creates a base-64 encoded ASCII string from a string of binary data.- Parameters:
stringToEncode- string to encodescriptable- the HtmlUnitScriptable- Returns:
- the 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 at some specified time later. The invocation occurs only if the window is opened after the delay and does not contain an other page than the one that originated the setTimeout.- Parameters:
context- the JavaScript contextthisObj- 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.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 contextthisObj- the scriptableargs- the arguments passed into the methodfunction- 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 scriptableargs- the arguments passed into the method- Returns:
- undefined
- See Also:
-