public class BackgroundJavaScriptFactory extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
BackgroundJavaScriptFactory()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
JavaScriptExecutor |
createJavaScriptExecutor(WebClient webClient)
Creates the
JavaScriptExecutor that will be used to handle JS. |
JavaScriptJob |
createJavaScriptJob(int initialDelay,
Integer period,
Runnable runnable)
Creates a new job.
|
org.htmlunit.javascript.background.JavaScriptFunctionJob |
createJavaScriptJob(int initialDelay,
Integer period,
String label,
WebWindow window,
org.htmlunit.corejs.javascript.Function function,
Object[] args)
Creates a new JavaScript execution job, where the JavaScript code to execute is a function.
|
JavaScriptJob |
createJavaScriptJob(int initialDelay,
Integer period,
String label,
WebWindow window,
String script)
Creates a new JavaScript execution job, where the JavaScript code to execute is a string.
|
JavaScriptJobManager |
createJavaScriptJobManager(WebWindow webWindow)
Creates a new JavaScriptJobManager for the given window.
|
JavaScriptJob |
createJavascriptXMLHttpRequestJob(org.htmlunit.corejs.javascript.ContextFactory contextFactory,
org.htmlunit.corejs.javascript.ContextAction<Object> action)
Creates a new job for XMLHttpRequestProcessing.
|
static void |
setFactory(BackgroundJavaScriptFactory factory)
Set the factory to a new one.
|
static BackgroundJavaScriptFactory |
theFactory()
Returns the current factory.
|
protected BackgroundJavaScriptFactory()
public static BackgroundJavaScriptFactory theFactory()
public static void setFactory(BackgroundJavaScriptFactory factory)
factory - the new factory.public JavaScriptJob createJavaScriptJob(int initialDelay, Integer period, String label, WebWindow window, String script)
initialDelay - the initial amount of time to wait before executing this jobperiod - the amount of time to wait between executions of this job (maybe null)label - the label for the jobwindow - the window to which the job belongsscript - the JavaScript code to executepublic org.htmlunit.javascript.background.JavaScriptFunctionJob createJavaScriptJob(int initialDelay, Integer period, String label, WebWindow window, org.htmlunit.corejs.javascript.Function function, Object[] args)
initialDelay - the initial amount of time to wait before executing this jobperiod - the amount of time to wait between executions of this job (maybe null)label - the label for the jobwindow - the window to which the job belongsfunction - the JavaScript code to executeargs - the arguments to pass into the function callpublic JavaScriptJob createJavascriptXMLHttpRequestJob(org.htmlunit.corejs.javascript.ContextFactory contextFactory, org.htmlunit.corejs.javascript.ContextAction<Object> action)
contextFactory - the ContextFactoryaction - the actionpublic JavaScriptJob createJavaScriptJob(int initialDelay, Integer period, Runnable runnable)
initialDelay - the initial amount of time to wait before executing this jobperiod - the amount of time to wait between executions of this job (maybe null)runnable - the runnable to runpublic JavaScriptExecutor createJavaScriptExecutor(WebClient webClient)
JavaScriptExecutor that will be used to handle JS.webClient - the WebClient of the executorpublic JavaScriptJobManager createJavaScriptJobManager(WebWindow webWindow)
webWindow - the window the JavaScriptJobManager will work forCopyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.