本文整理了Java中com.gargoylesoftware.htmlunit.WebClient.createJavaScriptEngineIfPossible()
方法的一些代码示例,展示了WebClient.createJavaScriptEngineIfPossible()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.createJavaScriptEngineIfPossible()
方法的具体详情如下:
包路径:com.gargoylesoftware.htmlunit.WebClient
类名称:WebClient
方法名:createJavaScriptEngineIfPossible
[英]Creates a JavaScript engine if possible.
[中]如果可能,创建一个JavaScript引擎。
代码示例来源:origin: org.jenkins-ci/htmlunit
/**
* Generic initialization logic used by all constructors. This method does not perform any
* parameter validation; such validation must be handled by the constructors themselves.
* @param browserVersion the browser version to simulate
* @param proxyConfig the proxy configuration to use
*/
private void init(final BrowserVersion browserVersion, final ProxyConfig proxyConfig) {
homePage_ = "http://www.gargoylesoftware.com/";
browserVersion_ = browserVersion;
proxyConfig_ = proxyConfig;
try {
scriptEngine_ = createJavaScriptEngineIfPossible(this);
}
catch (final NoClassDefFoundError e) {
scriptEngine_ = null;
}
// The window must be constructed AFTER the script engine.
addWebWindowListener(new CurrentWindowTracker());
currentWindow_ = new TopLevelWindow("", this);
fireWindowOpened(new WebWindowEvent(currentWindow_, WebWindowEvent.OPEN, null, null));
}
代码示例来源:origin: net.disy.htmlunit/htmlunit
/**
* Generic initialization logic used by all constructors. This method does not perform any
* parameter validation; such validation must be handled by the constructors themselves.
* @param browserVersion the browser version to simulate
* @param proxyConfig the proxy configuration to use
*/
private void init(final BrowserVersion browserVersion, final ProxyConfig proxyConfig) {
homePage_ = "http://www.gargoylesoftware.com/";
browserVersion_ = browserVersion;
proxyConfig_ = proxyConfig;
try {
scriptEngine_ = createJavaScriptEngineIfPossible(this);
}
catch (final NoClassDefFoundError e) {
scriptEngine_ = null;
}
// The window must be constructed AFTER the script engine.
addWebWindowListener(new CurrentWindowTracker());
currentWindow_ = new TopLevelWindow("", this);
fireWindowOpened(new WebWindowEvent(currentWindow_, WebWindowEvent.OPEN, null, null));
}
代码示例来源:origin: org.jvnet.hudson/htmlunit
/**
* Generic initialization logic used by all constructors. This method does not perform any
* parameter validation; such validation must be handled by the constructors themselves.
* @param browserVersion the browser version to simulate
* @param proxyConfig the proxy configuration to use
*/
private void init(final BrowserVersion browserVersion, final ProxyConfig proxyConfig) {
homePage_ = "http://www.gargoylesoftware.com/";
browserVersion_ = browserVersion;
proxyConfig_ = proxyConfig;
try {
scriptEngine_ = createJavaScriptEngineIfPossible(this);
}
catch (final NoClassDefFoundError e) {
scriptEngine_ = null;
}
// The window must be constructed AFTER the script engine.
addWebWindowListener(new CurrentWindowTracker());
currentWindow_ = new TopLevelWindow("", this);
fireWindowOpened(new WebWindowEvent(currentWindow_, WebWindowEvent.OPEN, null, null));
}
内容来源于网络,如有侵权,请联系作者删除!