本文整理了Java中com.gargoylesoftware.htmlunit.WebClient.getOnbeforeunloadHandler()
方法的一些代码示例,展示了WebClient.getOnbeforeunloadHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.getOnbeforeunloadHandler()
方法的具体详情如下:
包路径:com.gargoylesoftware.htmlunit.WebClient
类名称:WebClient
方法名:getOnbeforeunloadHandler
[英]Returns the onbeforeunload handler for this webclient.
[中]返回此webclient的onbeforeunload处理程序。
代码示例来源:origin: org.jenkins-ci/htmlunit
private boolean isOnbeforeunloadAccepted(final HtmlPage page, final Event event) {
if (event.jsxGet_type().equals(Event.TYPE_BEFORE_UNLOAD) && event.jsxGet_returnValue() != null) {
final OnbeforeunloadHandler handler = getWebClient().getOnbeforeunloadHandler();
if (handler == null) {
if (LOG.isWarnEnabled()) {
LOG.warn("document.onbeforeunload() returned a string in event.returnValue,"
+ " but no onbeforeunload handler installed.");
}
}
else {
final String message = Context.toString(event.jsxGet_returnValue());
return handler.handleEvent(page, message);
}
}
return true;
}
代码示例来源:origin: org.jvnet.hudson/htmlunit
private boolean isOnbeforeunloadAccepted(final HtmlPage page, final Event event) {
if (event.jsxGet_type().equals(Event.TYPE_BEFORE_UNLOAD) && event.jsxGet_returnValue() != null) {
final OnbeforeunloadHandler handler = getWebClient().getOnbeforeunloadHandler();
if (handler == null) {
if (LOG.isWarnEnabled()) {
LOG.warn("document.onbeforeunload() returned a string in event.returnValue,"
+ " but no onbeforeunload handler installed.");
}
}
else {
final String message = Context.toString(event.jsxGet_returnValue());
return handler.handleEvent(page, message);
}
}
return true;
}
代码示例来源:origin: net.disy.htmlunit/htmlunit
private boolean isOnbeforeunloadAccepted(final HtmlPage page, final Event event) {
if (event.jsxGet_type().equals(Event.TYPE_BEFORE_UNLOAD) && event.jsxGet_returnValue() != null) {
final OnbeforeunloadHandler handler = getWebClient().getOnbeforeunloadHandler();
if (handler == null) {
if (LOG.isWarnEnabled()) {
LOG.warn("document.onbeforeunload() returned a string in event.returnValue,"
+ " but no onbeforeunload handler installed.");
}
}
else {
final String message = Context.toString(event.jsxGet_returnValue());
return handler.handleEvent(page, message);
}
}
return true;
}
代码示例来源:origin: HtmlUnit/htmlunit
private boolean isOnbeforeunloadAccepted(final HtmlPage page, final Event event) {
if (event instanceof BeforeUnloadEvent) {
final BeforeUnloadEvent beforeUnloadEvent = (BeforeUnloadEvent) event;
if (beforeUnloadEvent.isBeforeUnloadMessageSet()) {
final OnbeforeunloadHandler handler = getWebClient().getOnbeforeunloadHandler();
if (handler == null) {
if (LOG.isWarnEnabled()) {
LOG.warn("document.onbeforeunload() returned a string in event.returnValue,"
+ " but no onbeforeunload handler installed.");
}
}
else {
final String message = Context.toString(beforeUnloadEvent.getReturnValue());
return handler.handleEvent(page, message);
}
}
}
return true;
}
代码示例来源:origin: net.sourceforge.htmlunit/htmlunit
private boolean isOnbeforeunloadAccepted(final HtmlPage page, final Event event, final ScriptResult result) {
if (event instanceof BeforeUnloadEvent) {
final BeforeUnloadEvent beforeUnloadEvent = (BeforeUnloadEvent) event;
if (beforeUnloadEvent.isBeforeUnloadMessageSet()) {
final OnbeforeunloadHandler handler = getWebClient().getOnbeforeunloadHandler();
if (handler == null) {
LOG.warn("document.onbeforeunload() returned a string in event.returnValue,"
+ " but no onbeforeunload handler installed.");
}
else {
final String message = Context.toString(beforeUnloadEvent.getReturnValue());
return handler.handleEvent(page, message);
}
}
}
return true;
}
内容来源于网络,如有侵权,请联系作者删除!