Package com.gargoylesoftware.htmlunit

Examples of com.gargoylesoftware.htmlunit.OnbeforeunloadHandler


        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;
    }
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.OnbeforeunloadHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.