SCRIPT
- the script typepublic interface AbstractJavaScriptEngine<SCRIPT>
JavaScriptEngine
.Modifier and Type | Method and Description |
---|---|
void |
addPostponedAction(PostponedAction action)
Adds an action that should be executed first when the script currently being executed has finished.
|
SCRIPT |
compile(HtmlPage owningPage,
org.htmlunit.corejs.javascript.Scriptable scope,
String sourceCode,
String sourceName,
int startLine)
Compiles the specified JavaScript code in the context of a given scope.
|
Object |
execute(HtmlPage page,
org.htmlunit.corejs.javascript.Scriptable scope,
SCRIPT script)
Executes the specified JavaScript code in the context of a given page.
|
Object |
execute(HtmlPage page,
org.htmlunit.corejs.javascript.Scriptable scope,
String sourceCode,
String sourceName,
int startLine)
Executes the specified JavaScript code in the context of a given page.
|
HtmlUnitContextFactory |
getContextFactory() |
JavaScriptConfiguration |
getJavaScriptConfiguration()
Gets the associated configuration.
|
long |
getJavaScriptTimeout()
Returns the number of milliseconds that a script is allowed to execute before being terminated.
|
void |
holdPosponedActions()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
void |
initialize(WebWindow webWindow,
Page page)
Performs initialization for the given webWindow and page.
|
boolean |
isScriptRunning()
Indicates if JavaScript is running in current thread.
|
void |
prepareShutdown()
Disable starting of new js threads.
|
void |
processPostponedActions()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
void |
registerWindowAndMaybeStartEventLoop(WebWindow webWindow)
Register WebWindow with the JavaScriptExecutor.
|
void |
setJavaScriptTimeout(long timeout)
Sets the number of milliseconds that a script is allowed to execute before being terminated.
|
void |
shutdown()
Shutdown the JavaScriptEngine.
|
JavaScriptConfiguration getJavaScriptConfiguration()
void addPostponedAction(PostponedAction action)
action
- the actionvoid processPostponedActions()
void registerWindowAndMaybeStartEventLoop(WebWindow webWindow)
webWindow
- the WebWindow to be registered.void initialize(WebWindow webWindow, Page page)
webWindow
- the web window to initialize forpage
- the page that will become the enclosing pagevoid setJavaScriptTimeout(long timeout)
timeout
- the timeout value, in millisecondslong getJavaScriptTimeout()
void prepareShutdown()
void shutdown()
boolean isScriptRunning()
true
if JavaScript is runningvoid holdPosponedActions()
SCRIPT compile(HtmlPage owningPage, org.htmlunit.corejs.javascript.Scriptable scope, String sourceCode, String sourceName, int startLine)
owningPage
- the page from which the code startedscope
- the scope in which to execute the javascript codesourceCode
- the JavaScript code to executesourceName
- the name that will be displayed on error conditionsstartLine
- the line at which the script source startsObject execute(HtmlPage page, org.htmlunit.corejs.javascript.Scriptable scope, SCRIPT script)
page
- the page that the code will execute withinscope
- the scope in which to executescript
- the script to executeObject execute(HtmlPage page, org.htmlunit.corejs.javascript.Scriptable scope, String sourceCode, String sourceName, int startLine)
page
- the page that the code will execute withinscope
- the scope in which to executesourceCode
- the JavaScript code to executesourceName
- the name that will be displayed on error conditionsstartLine
- the line at which the script source startsHtmlUnitContextFactory getContextFactory()
HtmlUnitContextFactory
Copyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.