return true;
}
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;
}