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 that has been encoded using Base64 encoding.static Stringbtoa(String stringToEncode, HtmlUnitScriptable scriptable) Creates a Base64-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 repeatedly at the specified interval.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 after the specified delay.
-
Method Details
-
atob
Decodes a string of data that has been encoded using Base64 encoding.- Parameters:
encodedData- the Base64-encoded string to decodescriptable- the callingHtmlUnitScriptable- Returns:
- the decoded value
-
btoa
Creates a Base64-encoded ASCII string from a string of binary data.- Parameters:
stringToEncode- the Latin-1 string to encodescriptable- the callingHtmlUnitScriptable- 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 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 repeatedly at the specified interval.- 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:
-