Package org.htmlunit.javascript.host
Class WindowOrWorkerGlobalScopeMixin
- java.lang.Object
-
- org.htmlunit.javascript.host.WindowOrWorkerGlobalScopeMixin
-
public final class WindowOrWorkerGlobalScopeMixin extends java.lang.Object
The implementation ofWindowOrWorkerGlobalScope
to be used by the implementers of the mixin.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
MIN_TIMER_DELAY
The minimum delay that can be used with setInterval() or setTimeout().
-
Constructor Summary
Constructors Modifier Constructor Description private
WindowOrWorkerGlobalScopeMixin()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
atob(java.lang.String encodedData)
Decodes a string of data which has been encoded using base-64 encoding.static java.lang.String
btoa(java.lang.String stringToEncode)
Creates a base-64 encoded ASCII string from a string of binary data.static java.lang.Object
setInterval(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable thisObj, java.lang.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 java.lang.Object
setTimeout(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable thisObj, java.lang.Object[] args, org.htmlunit.corejs.javascript.Function function)
Sets a chunk of JavaScript to be invoked at some specified time later.private static int
setTimeoutIntervalImpl(Window window, java.lang.Object code, int timeout, boolean isTimeout, java.lang.Object[] params)
-
-
-
Field Detail
-
MIN_TIMER_DELAY
private static final int MIN_TIMER_DELAY
The minimum delay that can be used with setInterval() or setTimeout(). Browser minimums are usually in the 10ms to 15ms range, but there's really no reason for us to waste that much time. http://jsninja.com/Timers#Minimum_Timer_Delay_and_Reliability- See Also:
- Constant Field Values
-
-
Method Detail
-
atob
public static java.lang.String atob(java.lang.String encodedData)
Decodes a string of data which has been encoded using base-64 encoding.- Parameters:
encodedData
- the encoded string- Returns:
- the decoded value
-
btoa
public static java.lang.String btoa(java.lang.String stringToEncode)
Creates a base-64 encoded ASCII string from a string of binary data.- Parameters:
stringToEncode
- string to encode- Returns:
- the encoded string
-
setTimeout
public static java.lang.Object setTimeout(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable thisObj, java.lang.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:
- MDN web docs
-
setInterval
public static java.lang.Object setInterval(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable thisObj, java.lang.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:
- MDN web docs
-
setTimeoutIntervalImpl
private static int setTimeoutIntervalImpl(Window window, java.lang.Object code, int timeout, boolean isTimeout, java.lang.Object[] params)
-
-