Package org.htmlunit.javascript.host
Class WindowOrWorkerGlobalScopeMixin
java.lang.Object
org.htmlunit.javascript.host.WindowOrWorkerGlobalScopeMixin
The implementation of
WindowOrWorkerGlobalScope
to be used by the implementers of the mixin.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
The minimum delay that can be used with setInterval() or setTimeout(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Decodes a string of data which has been encoded using base-64 encoding.static String
Creates a base-64 encoded ASCII string from a string of binary data.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.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.private static int
setTimeoutIntervalImpl
(Window window, Object code, int timeout, boolean isTimeout, Object[] params)
-
Field Details
-
MIN_TIMER_DELAY
private static final int MIN_TIMER_DELAYThe 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:
-
-
Constructor Details
-
WindowOrWorkerGlobalScopeMixin
private WindowOrWorkerGlobalScopeMixin()
-
-
Method Details
-
atob
Decodes a string of data which has been encoded using base-64 encoding.- Parameters:
encodedData
- the encoded string- Returns:
- the decoded value
-
btoa
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 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:
-
setTimeoutIntervalImpl
-